@ansaro/emailer
v0.1.3
Published
Send an email
Downloads
11
Readme
Emailer
Sends an email 💌
yarn add @ansaro/emailerUsage
Set environment variable SES_SOURCE to an email address that the email should be sent from (e.g. [email protected]).
sendEmail is an asynchronous function that takes these arguments:
recipientslist of email addresses to send email tosubjectis the subject for the emailbodyTextis the text version of the emailbodyHTMLis the HTML version of the email
const { sendEmail } = require("@ansaro/emailer");
const recipients = ["[email protected]"];
const subject = "Hello World";
const bodyText = "This is a plain email";
const bodyHTML = "<p>This is a <strong>nice</strong> email</p>";
async function () {
await sendEmail(recipients, subject, bodyText, bodyHTML);
}