nm-wrapper
v1.0.7
Published
Simple nodemailer-wrapper, compatible with ES5, written in TypeScript, singleton pattern. Written primarily for personal use. Contact for suggestions: [email protected]
Downloads
1
Maintainers
Readme
nm-wrapper
nm-wrapper is a TypeScript library that wraps around the famous nodemailer library. Written primarily for personal use. Compatible with ES5. Singleton pattern.
Installation
Use the package manager npm to install nm-wrapper.
npm i nm-wrapper
Usage
import { createMailService } from 'nm-wrapper';
// service configurations
const configuration = {
emailName: 'name-to-be-displayed',
transporter: {
service: 'gmail', //yahoo
secure: false,
debug: false,
logger: true,
port: 3000,
auth: {
user: '[email protected]',
pass: 'password',
},
},
};
// create an instance of nodemailer's MailService class,
// always uses that one instance
const mail = createMailService(configuration);
// use mailer
mail.sendMail('[email protected]', 'subject', '<h1>body</h1>');
Contributing
Suggestions and improvements are welcome
Support
Contact me at: [email protected]