summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKyle Partridge <partkyle@gmail.com>2012-01-10 15:47:00 -0800
committerKyle Partridge <partkyle@gmail.com>2012-01-10 15:47:00 -0800
commitc994e66bf37c30980a3d78b3a218e861880b4a12 (patch)
treeb12706a3a19155b1eca53a8ebb9633ed601fbf62 /lib
parent936c2c25ce818bf202be88d08e6cc42f18a94839 (diff)
downloadsendgrid-nodejs-c994e66bf37c30980a3d78b3a218e861880b4a12.zip
sendgrid-nodejs-c994e66bf37c30980a3d78b3a218e861880b4a12.tar.gz
sendgrid-nodejs-c994e66bf37c30980a3d78b3a218e861880b4a12.tar.bz2
fixed global scoping for the default params
Diffstat (limited to 'lib')
-rw-r--r--lib/email.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/email.js b/lib/email.js
index 1f540ab..5bdbbf9 100644
--- a/lib/email.js
+++ b/lib/email.js
@@ -12,24 +12,24 @@ function EmailHeaders() {
}
-/*
- * Default parameters for sending mail
- */
-var default_mail_params = {
- to: [],
- from: '',
- smtpapi: new SmtpapiHeaders(),
- subject: '',
- text: '',
- html: '',
- bcc: [],
- replyto: '',
- date: new Date(),
- files: [],
- headers: new EmailHeaders()
-};
-
function Email(params) {
+ /*
+ * Default parameters for sending mail
+ */
+ var default_mail_params = {
+ to: [],
+ from: '',
+ smtpapi: new SmtpapiHeaders(),
+ subject: '',
+ text: '',
+ html: '',
+ bcc: [],
+ replyto: '',
+ date: new Date(),
+ files: [],
+ headers: new EmailHeaders()
+ };
+
this.params = _.extend(default_mail_params, params);
}