mandrill-webhook-server

1.1.0 • Public • Published

mandrill-webhook-server

A small server to process Mandrill inbound web-hooks and uses Mandrill to forward the emails to another address.

Installation

  npm install mandrill-webhook-server --save

Usage

(function() {
  'use strict';
 
  var http = require('http');
  var mandrillWebhookServer = require('mandrill-webhook-server');
  var config = require('./config');
 
  var server = http.createServer(mandrillWebhookServer(config));
 
  var port = 3000;
 
  server.listen(port, function() {
    console.log('Listening on port %s', port);
  });
 
})();

Options

var config = {
  mandrillApiKey: 'your_mandrill_key',
  webhookAuthKey: 'webhooks_auth_key',
  domain: 'http://www.example.com',
  url: '/webhook',
  forwardTo: 'example@example.com',
  dontForwardEmailsFrom: ['example@example.com'],
};
  • mandrillApiKey: mandrill api key, used to send the emails
  • webhookAuthKey: mandrill webhook auth key, used for validating the Mandrill Signature
  • domain: domain of the webhook you set up on Mandrill, used for validating the Mandrill signature
  • url: url of the webhook you set up on Mandrill, used for validating the Mandrill Signature and routing
  • forwardTo: email to foward the messages to, where you want the mails sent
  • dontForwardEmailsFrom: ignore any emails from this list of addresses

Tests

  npm test

Links

api documentation

jscs Report

jshint Report

Contributing

Use Airbnb jscs style guide.

Add unit tests for any new or changed functionality. Lint and test your code.

Release History

Not yet released.

Legal Stuff

mandrill-webhook-request-validator is Copyright 2016 Aodhagán Collins. All Rights Reserved.

Distributed under MIT License.

Dependencies (6)

Dev Dependencies (14)

Package Sidebar

Install

npm i mandrill-webhook-server

Weekly Downloads

5

Version

1.1.0

License

MIT

Last publish

Collaborators

  • aigeec