summaryrefslogtreecommitdiffstats
path: root/examples/helpers/mail/example.js
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-05-10 00:16:47 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-05-10 00:16:47 -0700
commit0640a1f6ba62c780a11e9f3caecdf8024b6d2cba (patch)
treea1bc2fecf1d48d9aebcf57f1debf07c39a489d96 /examples/helpers/mail/example.js
parent25f33c27274546dfbdd6a4ebc1b8f2dbe3048200 (diff)
downloadsendgrid-nodejs-0640a1f6ba62c780a11e9f3caecdf8024b6d2cba.zip
sendgrid-nodejs-0640a1f6ba62c780a11e9f3caecdf8024b6d2cba.tar.gz
sendgrid-nodejs-0640a1f6ba62c780a11e9f3caecdf8024b6d2cba.tar.bz2
Ready for Beta
Diffstat (limited to 'examples/helpers/mail/example.js')
-rw-r--r--examples/helpers/mail/example.js28
1 files changed, 10 insertions, 18 deletions
diff --git a/examples/helpers/mail/example.js b/examples/helpers/mail/example.js
index 271c268..1cfe69e 100644
--- a/examples/helpers/mail/example.js
+++ b/examples/helpers/mail/example.js
@@ -1,21 +1,13 @@
function helloEmail(){
var helper = require('../../../lib/helpers/mail/mail.js')
- mail = new helper.Mail()
- email = new helper.Email("dx@sendgrid.com")
- mail.setFrom(email)
-
- personalization = new helper.Personalization()
- email = new helper.Email("elmer.thomas@sendgrid.com")
- personalization.addTo(email)
- mail.addPersonalization(personalization)
-
- mail.setSubject("Hello World from the SendGrid Node.js Library")
-
+ from_email = new helper.Email("dx@sendgrid.com")
+ to_email = new helper.Email("elmer.thomas@sendgrid.com")
+ subject = "Hello World from the SendGrid Node.js Library"
content = new helper.Content("text/plain", "some text here")
- mail.addContent(content)
- content = new helper.Content("text/html", "<html><body>some text here</body></html>")
- mail.addContent(content)
+ mail = new helper.Mail(from_email, subject, to_email, content)
+ email = new helper.Email("elmer.thomas+add_second_email@sendgrid.com")
+ mail.personalizations[0].addTo(email)
return mail.toJSON()
}
@@ -106,13 +98,13 @@ function kitchenSink(){
mail.setBatchId("some_batch_id")
- asm = new helper.ASM(3, [1,4,5])
- mail.setASM(asm)
+ asm = new helper.Asm(3, [1,4,5])
+ mail.setAsm(asm)
mail.setIpPoolName("23")
mail_settings = new helper.MailSettings()
- bcc = new helper.BCC(true, "elmer.thomas+spam@sendgrid.com")
+ bcc = new helper.Bcc(true, "elmer.thomas+spam@sendgrid.com")
mail_settings.setBcc(bcc)
footer = new helper.Footer(true, "some footer text", "<html><body>some footer text</body></html>")
mail_settings.setFooter(footer)
@@ -129,7 +121,7 @@ function kitchenSink(){
tracking_settings.setOpenTracking(open_tracking)
subscription_tracking = new helper.SubscriptionTracking(true, "text to insert into the text/plain portion of the message", "html to insert into the text/html portion of the message", "Optional tag to replace with the open image in the body of the message")
tracking_settings.setSubscriptionTracking(subscription_tracking)
- ganalytics = new helper.Ganalytics(true, "some utm source", "some utc medium", "some utm term", "some utm content", "some utm campaign", "some utm name")
+ ganalytics = new helper.Ganalytics(true, "some utm source", "some utc medium", "some utm term", "some utm content", "some utm campaign")
tracking_settings.setGanalytics(ganalytics)
mail.addTrackingSettings(tracking_settings)