1.0.0 • Published 4 years ago
@hkamran/utility-email v1.0.0
@hkamran/utility-email
An easy way to send emails (powered by Nodemailer)
Installation
$ npm i @hkamran/utility-emailUsage
- Create a transport client with
createClientfunction, passing the server name- Make sure the environment variables
SMTP_HOSTNAME,SMTP_PORT,SMTP_USERNAME, andSMTP_PASSWORDare set
- Make sure the environment variables
- Send an email with the
sendEmailfunctiontransport: The transport client created fromcreateClientfrom: The email you're sending fromto: The email you're sending tosubject: The email subjecthtml: The HTML version of the emailplainText: The plain-text version of the emailattachments(optional): A list of attachments- Must follow Nodemailer's attachments syntax
listUnsubscribe(optional): AList-Unsubscribeheader (more info)