nodemailer-ses-transport
Advanced tools
Comparing version 1.1.0 to 1.2.0
# Changelog | ||
## v1.2.0 2014-09-16 | ||
Added option `httpOptions` that maps to the object in underlying AWS.SES constructor. See options [here](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html). | ||
## v1.1.0 2014-07-31 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "nodemailer-ses-transport", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "SES transport for Nodemailer", | ||
@@ -5,0 +5,0 @@ "main": "src/ses-transport.js", |
@@ -31,2 +31,3 @@ # SES transport module for Nodemailer | ||
* **region** - *optional* Specify the region to send the service request to. Default to *us-east-1* | ||
* **httpOptions** - A set of options to pass to the low-level AWS HTTP request. See options in the [AWS-SES docs](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html). | ||
* **rateLimit** - *optional* Specify the amount of messages that [can be sent in 1 second](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html). For example if you want to send at most 5 messages in a second, set this value to 5. If you do not set it, rate limiting is not applied and messages are sent out immediatelly. | ||
@@ -33,0 +34,0 @@ |
@@ -38,3 +38,7 @@ 'use strict'; | ||
this.options.rateLimit = Number(options.rateLimit) || false; | ||
if (options.httpOptions) { | ||
this.options.httpOptions = options.httpOptions; | ||
} | ||
this.rateLimit = Number(options.rateLimit) || false; | ||
this.queue = []; | ||
@@ -59,3 +63,3 @@ this.sending = false; | ||
if (this.options.rateLimit) { | ||
if (this.rateLimit) { | ||
this.queue.push({ | ||
@@ -97,3 +101,3 @@ mail: mail, | ||
if (timeDelta >= 1000 / this.options.rateLimit) { | ||
if (timeDelta >= 1000 / this.rateLimit) { | ||
this.sending = false; | ||
@@ -105,3 +109,3 @@ setImmediate(this.processQueue.bind(this)); | ||
this.processQueue(); | ||
}.bind(this), Math.ceil(1000 / this.options.rateLimit - timeDelta)); | ||
}.bind(this), Math.ceil(1000 / this.rateLimit - timeDelta)); | ||
} | ||
@@ -108,0 +112,0 @@ }.bind(this)); |
10430
185
47