Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sendgrid/helpers

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sendgrid/helpers - npm Package Compare versions

Comparing version 6.0.0-beta.2 to 6.0.0-beta.3

32

classes/mail.js

@@ -58,6 +58,6 @@ 'use strict';

const {
to, from, replyTo, sendAt, subject, text, html, content, templateId,
personalizations, attachments, ipPoolName, batchId, asm, sections,
headers, categories, customArgs, mailSettings, trackingSettings,
substitutions, substitutionWrappers, isMultiple,
to, from, replyTo, cc, bcc, sendAt, subject, text, html, content,
templateId, personalizations, attachments, ipPoolName, batchId,
sections, headers, categories, customArgs, asm, mailSettings,
trackingSettings, substitutions, substitutionWrappers, isMultiple,
} = data;

@@ -91,7 +91,18 @@

//Create base data for personalizations
const baseData = {
cc,
bcc,
substitutions,
substitutionWrappers,
};
//Multiple individual emails
if (isMultiple && Array.isArray(to)) {
to.forEach(to => {
const subs = to.substitutions || substitutions;
this.addTo(to, subs, substitutionWrappers);
const toData = Object.assign({}, baseData, {to});
if (to.substitutions) {
toData.substitutions = to.substitutions;
}
this.addTo(toData);
});

@@ -102,3 +113,4 @@ }

else {
this.addTo(to, substitutions, substitutionWrappers);
const toData = Object.assign({}, baseData, {to});
this.addTo(toData);
}

@@ -229,6 +241,4 @@ }

*/
addTo(to, substitutions, substitutionWrappers) {
this.addPersonalization(new Personalization({
to, substitutions, substitutionWrappers,
}));
addTo(data) {
this.addPersonalization(new Personalization(data));
}

@@ -235,0 +245,0 @@

{
"name": "@sendgrid/helpers",
"description": "SendGrid NodeJS internal helpers",
"version": "6.0.0-beta.2",
"version": "6.0.0-beta.3",
"author": "SendGrid <dx@sendgrid.com> (sendgrid.com)",

@@ -6,0 +6,0 @@ "contributors": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc