Socket
Socket
Sign inDemoInstall

@auxilin/email-service

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auxilin/email-service

Mailgun wrapper


Version published
Weekly downloads
2
Maintainers
2
Weekly downloads
 
Created
Source

Email service

Auxilin.com — Production ready Node, React starter kit for building products at a warp speed

All Contributors npm version license PRs Welcome Build Status David Dependancy Status

Watch on GitHub Star on GitHub Follow Tweet @auxilin

Email service is using mailgun node client to send emails. We are inspired by mjml project. So, you can use mjml in your project and after compiling templates to simple html files use our project to inject params by handlebars and send emails. Let's dive into the docs.

Installation

npm i @auxilin/email-service

Quick example

To create a MailService class you should provide several params to its constructor

const MailService = require('@auxilin/email-service');

const mailService = new MailService({
  isSendEmail: false, // you can prevent email sending by this param
  savedEmailHtmlPath: __dirname, // if you want to save your email as html in development mode
  mailgun: {  // configs for https://www.npmjs.com/package/mailgun-js
    apiKey: 'test',
    domain: 'test.info',
  },
  templatesDir: __dirname, // absolute path to templates directory
});

After that you are able to run send method with several params

const result = await mailService.send(
  'email.html',
  { name: 'User name' },
  {
    from: 'Excited User <me@samples.mailgun.org>',
    to: 'test@test.com',
    subject: 'Test email',
  }
);

Full API Reference

API Reference.

Change Log

This project adheres to Semantic Versioning. Every release is documented on the Github Releases page.

License

Email-service is released under the MIT License.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Contributors

Thanks goes to these wonderful people (emoji key):

Evgeny Zhivitsa
Evgeny Zhivitsa

💻 🤔 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

FAQs

Package last updated on 04 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc