mailgun-js
Advanced tools
Comparing version 0.4.5 to 0.4.7
@@ -144,3 +144,6 @@ var https = require('https'); | ||
if (!error && res.headers['content-type'].indexOf('application/json') >= 0) { | ||
// FIXME: An ugly hack to overcome invalid response type in mailgun api (see http://bit.ly/1eF30fU). | ||
// We skip content-type validation for 'campaings' endpoint assuming it is JSON. | ||
var skipContentTypeCheck = res.req.path.match(/\/campaigns/); | ||
if (!error && (skipContentTypeCheck || (res.headers['content-type'].indexOf('application/json') >= 0))) { | ||
try { | ||
@@ -147,0 +150,0 @@ body = JSON.parse(chunks); |
@@ -454,4 +454,64 @@ module.exports = { | ||
] | ||
}, | ||
"campaign": { | ||
"description": "Manage campaigns. See http://documentation.mailgun.com/api-campaigns.html", | ||
"links": [ | ||
{ | ||
"description": "Create a new campaign.", | ||
"href": "/campaigns", | ||
"method": "POST", | ||
"title": "create", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["name"] | ||
}, | ||
{ | ||
"description": "Returns a list of campaigns.", | ||
"href": "/campaigns", | ||
"method": "GET", | ||
"title": "list" | ||
}, | ||
{ | ||
"description": "Get single campaign info.", | ||
"href": "/campaigns/{id}", | ||
"method": "GET", | ||
"title": "info" | ||
}, | ||
{ | ||
"description": "Update campaign.", | ||
"href": "/campaigns/{id}", | ||
"method": "PUT", | ||
"title": "update", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
{ | ||
"description": "Delete campaign.", | ||
"href": "/campaigns/{id}", | ||
"method": "DELETE", | ||
"title": "delete", | ||
"properties": { | ||
"limit": { | ||
"type": "number" | ||
}, | ||
"skip": { | ||
"type": "number" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}; |
{ | ||
"author": { | ||
"name": "Bojan Djurkovic <bojan@onelobby.com>" | ||
}, | ||
"name": "mailgun-js", | ||
"description": "Simple Node.js helper module for Mailgun API", | ||
"keywords": ["email", "mailgun"], | ||
"version": "0.4.5", | ||
"version": "0.4.7", | ||
"homepage": "https://github.com/1lobby/mailgun-js", | ||
@@ -28,2 +25,22 @@ "license": "MIT", | ||
}, | ||
"author": { | ||
"name": "Bojan Djurkovic <bojan@onelobby.com>" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Bojan Djurkovic" | ||
}, | ||
{ | ||
"name": "Adam Magaluk" | ||
}, | ||
{ | ||
"name": "Bill Johnston" | ||
}, | ||
{ | ||
"name": "Jamie Curtis" | ||
}, | ||
{ | ||
"name": "Serhiy Oplakanets" | ||
} | ||
], | ||
"devDependencies": { | ||
@@ -30,0 +47,0 @@ "mocha": "*" |
@@ -13,3 +13,3 @@ # mailgun.js | ||
Currently we implement the `send message` (non-MIME) API and the `Domains`, `Routes`, `Mailing Lists`, `Unsubscribes` and `Bounces` API's. These would be the most common | ||
Currently we implement the `send message` (non-MIME) API and the `Domains`, `Routes`, `Campaigns`, `Mailing Lists`, `Unsubscribes` and `Bounces` API's. These would be the most common | ||
and practical API's to be programmatically used. Others would be easy to add if needed. | ||
@@ -78,5 +78,9 @@ | ||
Sending attachments can be done in a few ways. We can use the path to a file in the `attachment` parameter. If the | ||
`attachment` parameter is of type `string` it is assumed to be the path to a file. | ||
Attachments can be sent using either the `attachment` or `inline` parameters. `inline` parameter can be use to send an | ||
attachment with `inline` disposition. It can be used to send inline images. Both types are supported with same mechanisms | ||
as described, we will just use `attachment` parameter in the documentation below but same stands for `inline`. | ||
Sending attachments can be done in a few ways. We can use the path to a file in the `attachment` parameter. | ||
If the `attachment` parameter is of type `string` it is assumed to be the path to a file. | ||
```js | ||
@@ -144,3 +148,2 @@ var filepath = path.join(__dirname, '/mailgun_logo.png'); | ||
#### Creating mailing list members | ||
@@ -147,0 +150,0 @@ |
45981
18
824
230