-
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
MailData must have dynamicTemplateData property #716
Conversation
The library doesn't send dynamicTemplateData added to the personalization to the SendGrid API. dynamicTemplateData in the MailData works.
Thanks @dyatko! |
Should the |
packages/helpers/classes/mail.d.ts
Outdated
@@ -152,6 +152,7 @@ export interface MailData { | |||
substitutionWrappers?: string[], | |||
|
|||
isMultiple?: boolean, | |||
dynamicTemplateData?: { [key: string]: string }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might need to be dynamicTemplateData?: { [key: string]: any }
because you can pass objects like this:
'dynamic_template_data': {
'subject': 'Hi!',
'name': 'Example User',
'location': {
'city': 'Birmingham',
'country': 'United Kingdom'
}
}
When you have a moment, could you please provide a second set of eyes on this one for us @spartan563? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks sensible to me 👍
Any updates here? Would love to get this in and not have to use the legacy templates. |
@thinkingserious nice, thank you! |
Hi guys, I just ran into this exact issue, and am happy to find that it's already taken care of 🚀 Two questions/remarks:
Cheers 🙌 |
Second the above, any immediate plans on pushing a release? |
Hello @edorivai, @kyleowens10, We publish our releases here and if you sign up for this mailing list, we'll send you an email upon release. I'm hoping to get this out within weeks if not days with any luck. For the long term, we are going to be thinking through a sustainable release schedule today with the goal of having more frequent and predictable release schedule With Best Regards, Elmer |
Just wasted 4 hours on this issue |
Do you have any plans to push a new release soon? |
@thinkingserious any idea yet on a timeline for release? |
@thinkingserious Adding to the list of people who had a bunch of time wasted by this not being deployed! Could you please deploy it, your docs are updated with these typings, but the package isn't! |
@thinkingserious any updates? |
Workaround: // https://github.com/sendgrid/sendgrid-nodejs/pull/716
interface MailDataFix extends MailData {
dynamicTemplateData?: { [key: string]: any };
} |
wasted days on this lmfao how is this very important fix still not in the npm package? |
Exactly what mercurial said 😄 Edit: I've fixed the issue by adding a defintion to my project
Why is this not deployed yet? @thinkingserious |
The types are there for me in For now I got this working by creating my own interface that extends from export interface IMailData extends MailData {
personalizations: [
{
dynamic_template_data?: { [key: string]: any };
}
];
} |
Hello @drewbietron, We have a deploy coming up that may fix this. I suggest you subscribe to our release newsletter to get the heads up. Thanks! With Best Regards, Elmer |
hello @thinkingserious , dynamic_template_data has to be snake case in type definitions. Would you be providing another release with typedef fixes? |
The library doesn't send dynamicTemplateData added to the personalization to the SendGrid API.
dynamicTemplateData in the MailData works.
Fixes
Checklist
Short description of what this PR does:
If you have questions, please send an email to Sendgrid, or file a Github Issue in this repository.