-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shared/common dynamic template data + personalizations #1299
Comments
I do absolutely support this. I thought the API would behave like the proposed one but it doesn't. |
Hi @adamreisnz! Can you send an email to [email protected] with this request? They will be able to generate a ticket for the correct internal Twilio Sendgrid team. |
I will try, but I have reported quite a few bugs (in the Sendgrid user interface) to Sendgrid support already, and that has all landed on deaf ears, with the same bugs still present years later. |
Interesting, my impression was that this was how the v3 api already worked :/ Source:
But I guess shared **EDIT |
If you set multiple recipients on the root node, they will all be listed in the e-mail. That's something you usually don't want in business scenarios. Otherwise you'd basically expose your customers. |
Issue Summary
As a developer, I want to be efficient with bandwidth and data that's being transmitted.
So when I need to send an email to 1,000 different people, and I use personalisations, it's great that I can send this in a single API request to Sendgrid.
However, there is still a lot of "waste" happening if I'm including dynamic template data which is the same for all the recipients
I am forced to include this in the
dynamicTemplateData
property of each individual personalisation.It would be trivial to allow us to specify shared or common
dynamicTemplateData
in the root of the request data (as you would for a regular email without personalisations, along with possible specificdynamicTemplateData
for each personalisation, and for Sendgrid to merge this on the server via a simple one level deep object merge, prior to sending emails.This way, we won't have to repeat shared data 1000 times, and we'll be working together towards a faster and more efficient internet.
Example
The following example illustrates the problem. Now I know this is a trivial example, but imagine that the payload is significantly larger. For example, this email may be going out to 1000 attendees that signed up to an event, so we're passing in dynamic template data specific to each attendee (e.g. their name), but also shared dynamic template data pertaining to the information of the event they all signed up to, which could be a significant payload size.
Current API:
Proposed API:
Later on the Sendgrid server (example code in JS):
The proposed API could potentially save a lot of bandwidth and would be far more efficient, especially with large dynamic data payloads.
I am aware that this is not a NodeJS library specific issue, but as I work with this library exclusively I wanted to post it here and hope that this issue can be raised internally with the correct API team.
I also raised a similar issue last year (#1154) which doesn't seem to have progressed much. Although note that this issue is slightly different, and I think far easier to implement at Sendgrid's end.
The text was updated successfully, but these errors were encountered: