Skip to content

Instantly share code, notes, and snippets.

@Qolzam
Created August 31, 2019 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qolzam/8361aef5c7180d185dfe1f3c931f9f3a to your computer and use it in GitHub Desktop.
Save Qolzam/8361aef5c7180d185dfe1f3c931f9f3a to your computer and use it in GitHub Desktop.
// 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