Removed unused 'cb' callback on send method of Email service and Email providers (#5371)

Signed-off-by: dacre-denny <dacre@mooce.co.nz>
This commit is contained in:
Dacre Denny 2020-03-21 02:02:47 +13:00 committed by GitHub
parent 7f3be5eb04
commit 45d83ea3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 11 deletions

View File

@ -48,7 +48,7 @@ const getProviderConfig = async env => {
module.exports = {
getProviderConfig,
async send(options, config, cb) {
async send(options, config) {
// Get email provider settings to configure the provider to use.
if (!config) {
config = await getProviderConfig(strapi.config.environment);
@ -67,6 +67,6 @@ module.exports = {
const actions = await provider.init(config);
// Execute email function of the provider for all files.
return actions.send(options, cb);
return actions.send(options);
},
};

View File

@ -44,13 +44,12 @@ module.exports = {
});
return {
send: (options, cb) => {
send: options => {
return new Promise((resolve, reject) => {
// Default values.
options = _.isObject(options) ? options : {};
options.from = options.from || config.amazon_ses_default_from;
options.replyTo =
options.replyTo || config.amazon_ses_default_replyto;
options.replyTo = options.replyTo || config.amazon_ses_default_replyto;
options.text = options.text || options.html;
options.html = options.html || options.text;

View File

@ -44,7 +44,7 @@ module.exports = {
});
return {
send: (options, cb) => {
send: options => {
return new Promise((resolve, reject) => {
// Default values.
options = isObject(options) ? options : {};

View File

@ -31,7 +31,7 @@ module.exports = {
sendgrid.setApiKey(config.sendgrid_api_key);
return {
send: (options, cb) => {
send: options => {
return new Promise((resolve, reject) => {
// Default values.
options = _.isObject(options) ? options : {};

View File

@ -26,7 +26,7 @@ module.exports = {
},
init: config => {
return {
send: (options, cb) => {
send: options => {
return new Promise((resolve, reject) => {
// Default values.
options = _.isObject(options) ? options : {};
@ -47,9 +47,7 @@ module.exports = {
},
function(err) {
if (err) {
reject([
{ messages: [{ id: 'Auth.form.error.email.invalid' }] },
]);
reject([{ messages: [{ id: 'Auth.form.error.email.invalid' }] }]);
} else {
resolve();
}