Use promise/resolve for threaded email
This commit is contained in:
@@ -14,11 +14,12 @@ function initEmailScript() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function sendEmail(toEmail, toName, subject, body) {
|
async function sendEmail(toEmail, toName, subject, body) {
|
||||||
if (!checkForSMTPModule()) {
|
if (!checkForSMTPModule()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Promise.resolve().then(() => {
|
||||||
module.smtp.send(
|
module.smtp.send(
|
||||||
getEmailConfig().smtp.host,
|
getEmailConfig().smtp.host,
|
||||||
getEmailConfig().smtp.port,
|
getEmailConfig().smtp.port,
|
||||||
@@ -30,7 +31,9 @@ function sendEmail(toEmail, toName, subject, body) {
|
|||||||
subject,
|
subject,
|
||||||
body,
|
body,
|
||||||
getEmailConfig().smtp.from,
|
getEmailConfig().smtp.from,
|
||||||
getEmailConfig().smtp.fromName);
|
getEmailConfig().smtp.fromName
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user