diff options
author | scottmotte <scott@scottmotte.com> | 2013-09-02 14:17:30 -0700 |
---|---|---|
committer | scottmotte <scott@scottmotte.com> | 2013-09-02 14:17:30 -0700 |
commit | ac70b2236357cf2978a3dc72472ff4bd29e0f552 (patch) | |
tree | a33001d155c9ed9a7ca93e99242a29bf282f17bb /lib/sendgrid.js | |
parent | 3afa904160661551c2a58c7fa5840d6a7e2ae99d (diff) | |
download | sendgrid-nodejs-ac70b2236357cf2978a3dc72472ff4bd29e0f552.zip sendgrid-nodejs-ac70b2236357cf2978a3dc72472ff4bd29e0f552.tar.gz sendgrid-nodejs-ac70b2236357cf2978a3dc72472ff4bd29e0f552.tar.bz2 |
Passes port in the options argument on initialization now
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r-- | lib/sendgrid.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js index ad97da4..7e33618 100644 --- a/lib/sendgrid.js +++ b/lib/sendgrid.js @@ -12,8 +12,9 @@ var Sendgrid = function(api_user, api_key, options) { return new Sendgrid(api_user, api_key, options); } - var _this = this; - this.options = options || {}; + var _this = this; + this.options = options || {}; + this.options.port = this.options.port || 587; var send = function() { if ( _this.options.api === 'smtp') { @@ -152,7 +153,6 @@ var Sendgrid = function(api_user, api_key, options) { * Expose public API calls */ this.version = package_json.version; - this.port = 587; this.SMTP = "SMTP"; this.Email = Email; this.SmtpapiHeaders = SmtpapiHeaders; @@ -162,6 +162,7 @@ var Sendgrid = function(api_user, api_key, options) { this.smtp = smtp; this.send = send; this.options = this.options; + this.port = this.options.port; return this; }; |