mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +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 = {
|
||||
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);
|
||||
},
|
||||
};
|
||||
|
@ -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;
|
||||
|
||||
|
@ -44,7 +44,7 @@ module.exports = {
|
||||
});
|
||||
|
||||
return {
|
||||
send: (options, cb) => {
|
||||
send: options => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Default values.
|
||||
options = isObject(options) ? options : {};
|
||||
|
@ -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 : {};
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user