Guest User

Untitled

a guest
Apr 27th, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. module.exports = function (context, myQueueItem) {
  2. var message = {
  3. "personalizations": [ { "to": [ { "email": "testto@test.com" } ] } ],
  4. from: { email: "testfrom@test.com" },
  5. subject: "Azure news",
  6. content: [{
  7. type: 'text/plain',
  8. value: myQueueItem
  9. }]
  10. };
  11. context.done(null, {message});
  12. };
  13.  
  14. const sgMail = require('@sendgrid/mail');
  15. sgMail.setApiKey(process.env.SENDGRID_API_KEY);
  16. const msg = {
  17. to: 'recipient@example.org',
  18. from: 'sender@example.org',
  19. subject: 'Hello attachment',
  20. html: '<p>Here’s an attachment for you!</p>',
  21. attachments: [
  22. {
  23. content: 'Some base 64 encoded attachment content',
  24. filename: 'some-attachment.txt',
  25. type: 'plain/text',
  26. disposition: 'attachment',
  27. contentId: 'mytext'
  28. },
  29. ],
  30. };
  31.  
  32. module.exports = function (context, myQueueItem) {
  33. var message = {
  34. "personalizations": [ { "to": [ { "email": "testto@test.com" } ] } ],
  35. from: { email: "testfrom@test.com" },
  36. subject: "Azure news",
  37. content: [{
  38. type: 'text/plain',
  39. value: myQueueItem
  40. }],
  41. attachments: [
  42. {
  43. content: 'Some base 64 encoded attachment content',
  44. filename: 'some-attachment.txt',
  45. type: 'plain/text',
  46. disposition: 'attachment',
  47. contentId: 'mytext'
  48. },
  49. ]
  50. };
  51. context.done(null, {message});
  52. };
Add Comment
Please, Sign In to add comment