Last active
June 28, 2020 10:33
-
-
Save AaronMcCaughan/d83c6e6f10e4e42558d766abc1682903 to your computer and use it in GitHub Desktop.
Sample script to trigger email notifications
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
let run = function (args) { | |
return new Promise((resolve,reject)=>{ | |
console.log('Sending email'); | |
mailData = { | |
to: 'email@email.com', // Required - Address data can be passed as a single string with commmas separating addresses or an array of single address strings. ie: ['a@a.com', 'b@b.com'] | |
//cc: 'a@a.com', //optional | |
//bcc: 'a@a.com', //optional | |
subject: 'Test Email', //Required | |
body: 'This email was sent from a script. <b> Bold Text </b> <i>Italicized text</i>', //Required - This accepts HTML or standard text input. | |
signature: '\n\n\nRegards\n John Smith' //Optional. If excluded a default Plutora signature will be appended. | |
}; | |
mailer.send(mailData) | |
.then(response => { | |
resolve(console.log('Email sent successfully.\n' + response)); | |
}) | |
.catch(error => { | |
reject(console.log('Failed to send email.\n' + error)); | |
}); | |
}); | |
}; | |
module.exports = { | |
run: run | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment