nm-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

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: 'your-email@gmail.com',
      pass: 'password',
    },
  },
};

// create an instance of nodemailer's MailService class,
// always uses that one instance
const mail = createMailService(configuration);

// use mailer
mail.sendMail('send-to@gmail.com', 'subject', '<h1>body</h1>');

Contributing

Suggestions and improvements are welcome

Support

Contact me at: sediballiu03@gmail.com

License

MIT

Package Sidebar

Install

npm i nm-wrapper

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

16.2 kB

Total Files

19

Last publish

Collaborators

  • sedib