summaryrefslogtreecommitdiffstats
path: root/test/helpers/mail/test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpers/mail/test.js')
-rw-r--r--test/helpers/mail/test.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/helpers/mail/test.js b/test/helpers/mail/test.js
index 250fac1..44ce155 100644
--- a/test/helpers/mail/test.js
+++ b/test/helpers/mail/test.js
@@ -20,7 +20,7 @@ describe('helloEmail', function () {
content = new helper.Content("text/html", "<html><body>some text here</body></html>")
mail.addContent(content)
- test_payload = '{"from":{"email":"dx@sendgrid.com"},"personalization":[{"to":[{"email":"elmer.thomas@sendgrid.com"}]}],"subject":"Hello World from the SendGrid Node.js Library","content":[{"type":"text/plain","value":"some text here"},{"type":"text/html","value":"<html><body>some text here</body></html>"}]}'
+ test_payload = '{"from":{"email":"dx@sendgrid.com"},"personalizations":[{"to":[{"email":"elmer.thomas@sendgrid.com"}]}],"subject":"Hello World from the SendGrid Node.js Library","content":[{"type":"text/plain","value":"some text here"},{"type":"text/html","value":"<html><body>some text here</body></html>"}]}'
it('builds the correct payload', function() {
assert.equal(JSON.stringify(mail.toJSON()), test_payload, 'payload is correct')
@@ -144,7 +144,7 @@ describe('kitchenSink', function () {
email = new helper.Email("dx+reply@sendgrid.com", "DX")
mail.setReplyTo(email)
- test_payload = '{"from":{"email":"dx@sendgrid.com","name":"DX"},"personalization":[{"to":[{"email":"elmer.thomas@sendgrid.com","name":"Elmer Thomas"},{"email":"elmer.thomas@gmail.com","name":"Elmer Thomas Personal"}],"cc":[{"email":"elmer.thomas+cc@sendgrid.com","name":"Elmer Thomas CC"},{"email":"elmer.thomas+cc@gmail.com","name":"Elmer Thomas Personal CC"}],"bcc":[{"email":"elmer.thomas+bcc@sendgrid.com","name":"Elmer Thomas BCC"},{"email":"elmer.thomas+bcc@gmail.com","name":"Elmer Thomas Personal BCC"}],"subject":"Hello World from the Personalized SendGrid Node.js Library","headers":{"X-Test":"True","X-Test2":"False"},"substitutions":{"%name%":"Elmer","%city%":"Riverside"},"custom_args":{"timing":"morning","type":"marketing"},"send_at":1443636899}],"subject":"Hello World from the SendGrid Node.js Library","content":[{"type":"text/plain","value":"some text here"},{"type":"text/html","value":"<html><body>some text here</body></html>"},{"type":"text/calendar","value":"Party Time"}],"attachments":[{"content":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12","type":"application/pdf","filename":"balance_001.pdf","disposition":"attachment"},{"content":"BwdW","type":"image/png","filename":"banner.png","disposition":"inline","content_id":"banner"}],"template_id":"439b6d66-4408-4ead-83de-5c83c2ee313a","sections":{"%section1%":"Textforasubstitutiontagofsection1","%section2%":"Textforasubstitutiontagofsection2"},"headers":{"X-Test3":"1","X-Test4":"2"},"categories":["January","2015"],"custom_args":{"timing":"evening","type":"summer_contest"},"send_at":1443636899,"batch_id":"some_batch_id","asm":{"group_id":3,"groups_to_display":[1,4,5]},"ip_pool_name":"23","mail_settings":{"bcc":{"enable":true,"email":"elmer.thomas+spam@sendgrid.com"},"footer":{"enable":true,"text":"some footer text","html":"<html><body>some footer text</body></html>"},"sandbox_mode":{"enable":true},"spam_check":{"enable":true,"threshold":1,"post_to_url":"https://gotchya.example.com"}},"tracking_settings":{"click_tracking":{"enable":false,"enable_text":false},"open_tracking":{"enable":true,"substitution_tag":"Optional tag to replace with the open image in the body of the message"},"subscription_tracking":{"enable":true,"text":"text to insert into the text/plain portion of the message","html":"html to insert into the text/html portion of the message","substitution_tag":"Optional tag to replace with the open image in the body of the message"},"ganalytics":{"enable":true,"utm_source":"some utm source","utm_medium":"some utc medium","utm_term":"some utm term","utm_content":"some utm content","utm_campaign":"some utm campaign"}},"reply_to":{"email":"dx+reply@sendgrid.com","name":"DX"}}'
+ test_payload = '{"from":{"email":"dx@sendgrid.com","name":"DX"},"personalizations":[{"to":[{"email":"elmer.thomas@sendgrid.com","name":"Elmer Thomas"},{"email":"elmer.thomas@gmail.com","name":"Elmer Thomas Personal"}],"cc":[{"email":"elmer.thomas+cc@sendgrid.com","name":"Elmer Thomas CC"},{"email":"elmer.thomas+cc@gmail.com","name":"Elmer Thomas Personal CC"}],"bcc":[{"email":"elmer.thomas+bcc@sendgrid.com","name":"Elmer Thomas BCC"},{"email":"elmer.thomas+bcc@gmail.com","name":"Elmer Thomas Personal BCC"}],"subject":"Hello World from the Personalized SendGrid Node.js Library","headers":{"X-Test":"True","X-Test2":"False"},"substitutions":{"%name%":"Elmer","%city%":"Riverside"},"custom_args":{"timing":"morning","type":"marketing"},"send_at":1443636899}],"subject":"Hello World from the SendGrid Node.js Library","content":[{"type":"text/plain","value":"some text here"},{"type":"text/html","value":"<html><body>some text here</body></html>"},{"type":"text/calendar","value":"Party Time"}],"attachments":[{"content":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12","type":"application/pdf","filename":"balance_001.pdf","disposition":"attachment"},{"content":"BwdW","type":"image/png","filename":"banner.png","disposition":"inline","content_id":"banner"}],"template_id":"439b6d66-4408-4ead-83de-5c83c2ee313a","sections":{"%section1%":"Textforasubstitutiontagofsection1","%section2%":"Textforasubstitutiontagofsection2"},"headers":{"X-Test3":"1","X-Test4":"2"},"categories":["January","2015"],"custom_args":{"timing":"evening","type":"summer_contest"},"send_at":1443636899,"batch_id":"some_batch_id","asm":{"group_id":3,"groups_to_display":[1,4,5]},"ip_pool_name":"23","mail_settings":{"bcc":{"enable":true,"email":"elmer.thomas+spam@sendgrid.com"},"footer":{"enable":true,"text":"some footer text","html":"<html><body>some footer text</body></html>"},"sandbox_mode":{"enable":true},"spam_check":{"enable":true,"threshold":1,"post_to_url":"https://gotchya.example.com"}},"tracking_settings":{"click_tracking":{"enable":false,"enable_text":false},"open_tracking":{"enable":true,"substitution_tag":"Optional tag to replace with the open image in the body of the message"},"subscription_tracking":{"enable":true,"text":"text to insert into the text/plain portion of the message","html":"html to insert into the text/html portion of the message","substitution_tag":"Optional tag to replace with the open image in the body of the message"},"ganalytics":{"enable":true,"utm_source":"some utm source","utm_medium":"some utc medium","utm_term":"some utm term","utm_content":"some utm content","utm_campaign":"some utm campaign"}},"reply_to":{"email":"dx+reply@sendgrid.com","name":"DX"}}'
it('builds the correct payload', function() {
assert.equal(JSON.stringify(mail.toJSON()), test_payload, 'payload is correct')