Example for sending SMTP based emails from a ClearBlade service.
This is an ipm package, which contains one or more reusable assets within the ipm Community. The 'package.json' in this repo is a ipm spec's package.json, here, which is a superset of npm's package.json spec, here.
You must have an email account, such as GMail, and its STMP Host address.
Enter your configuration in the MailerConstants
Code Library:
const ORIGIN_EMAIL_ADDRESS ="<ORIGIN_EMAIL_ADDRESS" // ex. [email protected]
const ORIGIN_EMAIL_PASSWORD = "<ORIGIN_EMAIL_PASSWORD>" // ex. "K1LL3RPW"
const RECIPIENT_EMAIL_ADDRESS = "<RECIPIENT_EMAIL_ADDRESS>" // ex. "[email protected]"
const host = "<HOST>" // ex. "smtp.gmail.com"
const port = "<PORT>" // ex. "587"
MailerConstants
- A constants library to have a centralized location for constants like API-key.
MailerExampleSend
- sends an email with configuration from above
MailerTestSetup
- Tests if the constants for mailer library are set or not.