Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mandrill.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var request = require('request'),
var request = require('requestretry'),
_ = require('underscore');

var MANDRILL_API_ROOT = 'https://mandrillapp.com/api/1.0/';
var MANDRILL_API_ROOT = 'https://mandrillapp.com/api/1.0/';

function makeMandrill(key)
{
Expand All @@ -23,6 +23,10 @@ function makeMandrill(key)
var requestOptions = {
method: 'POST',
url: MANDRILL_API_ROOT + path + '.' + format,

// The above parameters are specific to Request-retry:
maxAttempts: 4, // try 4 times
retryDelay: 1000 // wait for 1s before trying again
};

requestOptions['body'] = JSON.stringify( _.extend({ key: key }, opts) );
Expand Down
57 changes: 33 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
{
"name" : "node-mandrill",
"version" : "1.0.1",
"description" : "A node.js wrapper for MailChimp's Mandrill API.",
"author" : "Jim Rubenstein <[email protected]> (http://twitter.com/jim_rubenstein)",
"main" : "mandrill.js",
"repository" : {
"type" : "git",
"url" : "http://github.com/jimrubenstein/node-mandrill.git"
},
"bugs": {
"url": "https://github.com/jimrubenstein/node-mandrill/issues"
},
"engines": {
"node": ">= 0.8.2"
},
"dependencies": {
"request": ">= 2.9.100",
"underscore": ">= 1.3.3"
},
"homepage": "http://github.com/jimrubenstein/node-mandrill.git",
"keywords": ["mandrill", "node mandrill", "mandrill api", "email", "send email", "email api", "mailchimp", "mailchimp api", "email mailchimp"]
}

{
"name": "node-mandrill",
"version": "1.0.1",
"description": "A node.js wrapper for MailChimp's Mandrill API.",
"author": "Jim Rubenstein <[email protected]> (http://twitter.com/jim_rubenstein)",
"main": "mandrill.js",
"repository": {
"type": "git",
"url": "http://github.com/jimrubenstein/node-mandrill.git"
},
"bugs": {
"url": "https://github.com/jimrubenstein/node-mandrill/issues"
},
"engines": {
"node": ">= 0.8.2"
},
"dependencies": {
"underscore": ">= 1.3.3",
"requestretry": "~1.0.1"
},
"homepage": "http://github.com/jimrubenstein/node-mandrill.git",
"keywords": [
"mandrill",
"node mandrill",
"mandrill api",
"email",
"send email",
"email api",
"mailchimp",
"mailchimp api",
"email mailchimp"
]
}