mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 17:29:14 +00:00
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:
parent
7f3be5eb04
commit
45d83ea3f5
@ -48,7 +48,7 @@ const getProviderConfig = async env => {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
getProviderConfig,
|
getProviderConfig,
|
||||||
async send(options, config, cb) {
|
async send(options, config) {
|
||||||
// Get email provider settings to configure the provider to use.
|
// Get email provider settings to configure the provider to use.
|
||||||
if (!config) {
|
if (!config) {
|
||||||
config = await getProviderConfig(strapi.config.environment);
|
config = await getProviderConfig(strapi.config.environment);
|
||||||
@ -67,6 +67,6 @@ module.exports = {
|
|||||||
const actions = await provider.init(config);
|
const actions = await provider.init(config);
|
||||||
|
|
||||||
// Execute email function of the provider for all files.
|
// Execute email function of the provider for all files.
|
||||||
return actions.send(options, cb);
|
return actions.send(options);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -44,13 +44,12 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
send: (options, cb) => {
|
send: options => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Default values.
|
// Default values.
|
||||||
options = _.isObject(options) ? options : {};
|
options = _.isObject(options) ? options : {};
|
||||||
options.from = options.from || config.amazon_ses_default_from;
|
options.from = options.from || config.amazon_ses_default_from;
|
||||||
options.replyTo =
|
options.replyTo = options.replyTo || config.amazon_ses_default_replyto;
|
||||||
options.replyTo || config.amazon_ses_default_replyto;
|
|
||||||
options.text = options.text || options.html;
|
options.text = options.text || options.html;
|
||||||
options.html = options.html || options.text;
|
options.html = options.html || options.text;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
send: (options, cb) => {
|
send: options => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Default values.
|
// Default values.
|
||||||
options = isObject(options) ? options : {};
|
options = isObject(options) ? options : {};
|
||||||
|
@ -31,7 +31,7 @@ module.exports = {
|
|||||||
sendgrid.setApiKey(config.sendgrid_api_key);
|
sendgrid.setApiKey(config.sendgrid_api_key);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
send: (options, cb) => {
|
send: options => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Default values.
|
// Default values.
|
||||||
options = _.isObject(options) ? options : {};
|
options = _.isObject(options) ? options : {};
|
||||||
|
@ -26,7 +26,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
init: config => {
|
init: config => {
|
||||||
return {
|
return {
|
||||||
send: (options, cb) => {
|
send: options => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Default values.
|
// Default values.
|
||||||
options = _.isObject(options) ? options : {};
|
options = _.isObject(options) ? options : {};
|
||||||
@ -47,9 +47,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
function(err) {
|
function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject([
|
reject([{ messages: [{ id: 'Auth.form.error.email.invalid' }] }]);
|
||||||
{ messages: [{ id: 'Auth.form.error.email.invalid' }] },
|
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user