Advertisement
danielsosunov

Untitled

Jul 23rd, 2019
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var data = {
  2.         "templateId":template_id,
  3.         "to":[{"name":object.recipient_name,"email":object.recipient_email}],
  4.         "cc":[{"email":object.sender_email}],
  5.         "tags":["Recipient Email"],
  6.         "params":{
  7.             "SUBJECT":subject,
  8.             "TITLE":subject.toUpperCase(),
  9.             "MESSAGE":object.personalized_message,
  10.             "IMAGE":object.personalized_doodle,"IMAGE_WIDTH":IMAGE_WIDTH,"IMAGE_HEIGHT":IMAGE_HEIGHT,
  11.             "NOTE":object.delivery_completed_note.toUpperCase(),
  12.             "COUPON":object.coupon_code,
  13.         },
  14.     }
  15.     await
  16.         axios({
  17.         url:"https://api.sendinblue.com/v3/smtp/email",
  18.         method:'post',
  19.         headers:{ 'api-key': sendinblue },
  20.         data: data
  21.         })
  22.         .then(function (response) {
  23.             print(`Recipient Sent:${object.recipient_email}`);
  24.         })
  25.         .catch(function (err) {
  26.             print(`Recipient Err:${err}`);
  27.         })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement