Socket
Socket
Sign inDemoInstall

nodemailer-mailgunapi-transport

Package Overview
Dependencies
20
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nodemailer-mailgunapi-transport

Mailgun api transport module for Nodemailer


Version published
Weekly downloads
3
decreased by-76.92%
Maintainers
1
Install size
561 kB
Created
Weekly downloads
 

Readme

Source

##nodemailer-mailgunapi-transport

Build

Mailgun api transport module for Nodemailer 1.0+

Install

npm install nodemailer-mailgunapi-transport

Usage

var nodemailer = require("nodemailer");
var mailgunApiTransport = require("nodemailer-mailgunapi-transport");
var transporter = nodemailer.createTransport(mailgunApiTransport({apiKey: "MAILGUN_API_KEY"}));

Options

  • apiKey is api key of Mailgun (required)
  • domain is specific domain of Mailgun

Extra

Also this mailgun api transport contains some usefull functions to register routes to forward email messages from addresses like "reply-{ID}@your-domain.com" to your urls (you can pass extracted ID as url param '\1', i.e. like https://my-domain/emailCallback/\1). Read here more about mailgun routes.

var transport = mailgunApiTransport({apiKey: "MAILGUN_API_KEY"});

transport.registerEmailPattern(emailPattern, callbackUrl, "route description", function(err, routeId){}); // create (or use exisitng) route for email pattern (you can use {ID} inside it, extracted id can be passed to callback url as param)
// Example
// emailPattern: reply-{ID}@test.com, callbackUrl: http://test.com/callback/\1
// all incoming messages to reply-1000@test.com will be redirected to http://test.com/callback/1000, etc
// Parameter {ID} is optional. You can use it only if you need. The value of ID can be any letters and/or numbers


transport.parseMessage(message); //transform incoming message of callback url handler to pretty form

transport.verifySignature(token, timestamp, signature); //allow to check signature of incoming message inside callback handler

Keywords

FAQs

Last updated on 02 Sep 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc