-
Notifications
You must be signed in to change notification settings - Fork 587
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
Add Dynamic Template Support #724
Add Dynamic Template Support #724
Conversation
08d2999
to
75de374
Compare
75de374
to
a7e9022
Compare
@thinkingserious Please, is this coming out any soon? |
Hi @JaEdmuva, Yes, we have just released helpers for PHP and now we working to release the Python helpers. C# is next :) With Best Regards, Elmer |
Just a little suggest at https://github.com/sendgrid/sendgrid-csharp/pull/724/files#diff-a590903d5d8f3627d1e50f903d70631cR71 If the
I could do something like: var msg = new SendGridMessage
{
...
Personalizations = new System.Collections.Generic.List<Personalization>()
{
new Personalization
{
...
DynamicTemplateData = new System.Collections.Generic.Dictionary<string, object>()
{
{ "list", new List<dynamic>()
{
new {title = "Title 1"},
new {title = "Title 2"}
}
}
}
}
} I couldn't get the tests to work, else I would have made a PR myself. The scenario above worked for my template and I think it's not that big of a change. What do you think? |
@GlennGeelen yeah that sounds like a good idea to me, especially with the deep object replacement support, I'll look into updating my PR accordingly. Cheers 😄 |
Shouldn't |
@puco I like that idea, please see the latest commit. I've gone for simplicity initially and not added |
3203526
to
7eafad1
Compare
38a42e3
to
3f2c708
Compare
Hey @thinkingserious, I was just wondering if your comment here #716 (comment) means this PR is redundant? |
Not at all @carl-hartshorn, I working from your PR :) |
@thinkingserious ah brilliant 😁 thank you |
@thinkingserious , @carl-hartshorn Hi, can we already use this PR ? When I try to add dynamic template data to a new personalization, it has no parameter for it. I am currently using a workaround which enables me to pass strings, integers etc but I am currently not able to use objects in my templates |
Hello @carl-hartshorn, |
Hello @Pieter-1337, You can use this PR, but you might want to wait until I publish it on Nuget. The final step before I do that is to QA each of the relevant cases in USE_CASES.md. With Best Regards, Elmer |
@thinkingserious Is there an expected turnaround time on that? My team is currently evaluating SendGrid for a project and I'm trying to set expectations around when this will be available. Also, thanks to you and @carl-hartshorn for taking care of this! |
@thinkingserious yes we are waiting for this realese.. few days? |
Yes, I don't think it should be more than a few working days. |
Did this actually make it into the 9.10. release as the change log suggests? I've updated to 9.10 and am referencing it, but none of the changes are there (no methods on MailHelper, not property on Personalizations, etc) |
@ThomasChristmann It did make it. I'm using it right now. Check out SendGridMessage#SetTemplateData and SendGridMessage#SetTemplateId |
Closes #716
Checklist
Short description of what this PR does:
DynamicTemplateData
property toPersonalization
SendGridMessage
:AddDynamicTemplateDataValue
AddDynamicTemplateDataValues
MailHelper
methods for creating dynamic template emailsCreateSingleDynamicTemplateEmail
CreateSingleDynamicTemplateEmailToMultipleRecipients
CreateMultipleDynamicTemplateEmailsToMultipleRecipients