Created
August 31, 2019 01:00
-
-
Save Qolzam/8361aef5c7180d185dfe1f3c931f9f3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Email callback handler | |
const emailCallback = (emailResult) => { | |
let result = null | |
if (emailResult.error) { | |
result = { | |
"text": "There is problem!", | |
"attachments": [ | |
{ | |
"text": JSON.stringify(emailResult.error) | |
} | |
] | |
} | |
} else { | |
result = { | |
"text": "Email has been sent: " + emailInfo.emails + ' : ' + emailInfo.subject, | |
"attachments": [ | |
{ | |
"text": htmlBody | |
} | |
] | |
} | |
} | |
callback(undefined, result) | |
} | |
// Send email | |
utils.sendEmail(emailInfo.emails, emailInfo.subject, htmlBody, emailCallback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment