Comparing version 1.4.1 to 1.5.0
@@ -15,3 +15,3 @@ var defaults = require('./clientDefaults.js'); | ||
if (!apiKey) { | ||
throw ("You must provide your Postmark Account API token."); | ||
throw new Error("You must provide your Postmark Account API token."); | ||
} | ||
@@ -18,0 +18,0 @@ this.options = merge({}, defaults, options); |
@@ -23,3 +23,3 @@ (function() { | ||
if (!serverKey) { | ||
throw ("You must provide your postmark API key"); | ||
throw new Error("You must provide your postmark API key"); | ||
} | ||
@@ -284,3 +284,42 @@ this.options = merge({}, defaults, options); | ||
/** | ||
* Get the Clicks for Outbound Messages. The default batch size is 100, and offset is 0. | ||
* You can make successive calls to the API to retrieve additional Opens information. | ||
* | ||
* @memberof Client.prototype | ||
* @method getMessageClicks | ||
* @param {object} [filter] Optional filtering parameters. | ||
* @param {PostmarkCallback} callback A standard callback that is called when the API request completes. | ||
* @return {Promise} If no callback is passed, returns a Promise with the JSON response from the API (or error). | ||
*/ | ||
Client.prototype.getMessageClicks = function(filter, callback) { | ||
callback = coalesceCallback(filter, callback); | ||
filter = merge({ | ||
count: 100, | ||
offset: 0 | ||
}, filter); | ||
return this.processRequestWithoutBody('/messages/outbound/clicks', 'GET', filter, callback); | ||
}; | ||
/** | ||
* Get Click information for a single Outbound Message. The default batch size is 100, and offset is 0. | ||
* | ||
* @memberof Client.prototype | ||
* @method getMessageClicksForSingleMessage | ||
* @param {number} id The ID of the Message for which you wish to retrieve Opens. | ||
* @param {object} [filter] Optional filtering parameters. | ||
* @param {PostmarkCallback} callback A standard callback that is called when the API request completes. | ||
* @return {Promise} If no callback is passed, returns a Promise with the JSON response from the API (or error). | ||
*/ | ||
Client.prototype.getMessageClicksForSingleMessage = function(id, filter, callback) { | ||
callback = coalesceCallback(filter, callback); | ||
filter = merge({ | ||
count: 100, | ||
offset: 0 | ||
}, filter); | ||
return this.processRequestWithoutBody('/messages/outbound/clicks/' + id, 'GET', filter, callback); | ||
}; | ||
/** | ||
* Get Open information for a single Outbound Message. The default batch size is 100, and offset is 0. | ||
@@ -287,0 +326,0 @@ * |
@@ -9,4 +9,4 @@ { | ||
], | ||
"version": "1.4.1", | ||
"author": "Chris Williams <voodootikigod@gmail.com>", | ||
"version": "1.5.0", | ||
"author": "Andrew Theken <andrew+postmark.js@wildbit.com>", | ||
"contributors": [ | ||
@@ -13,0 +13,0 @@ "Aaron Blum", |
@@ -98,3 +98,3 @@ ## Postmark.js | ||
postmark.sendEmailBatch(messages, function (error, batchResults) { | ||
client.sendEmailBatch(messages, function (error, batchResults) { | ||
if (error) { | ||
@@ -108,3 +108,3 @@ console.error("Unable to send via postmark: " + error.message); | ||
The Postmark API will return an array of statuses, one for each message sent. You may iterate over the `batchResults` for information about each sent message. For further details, please see the [Postmark Batch API](http://developer.postmarkapp.com/developer-build.html#batching-messages). | ||
The Postmark API will return an array of statuses, one for each message sent. You may iterate over the `batchResults` for information about each sent message. For further details, please see the [Postmark Batch API](https://postmarkapp.com/developer/user-guide/sending-email/sending-with-api#batch-emails). | ||
@@ -111,0 +111,0 @@ ### Sending an Email using a Template |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3504830
124654