-
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
Add Dynamic Template Support #703
Comments
Please update your documentation- I just spent an hour trying to figure out why substitutions were not working with the v3 API. |
My apologies for the poor experience @jharris-code. I've added your vote to this issue to help it gain priority. I think it will be updated soon because we sone have PR #711. |
It is very silly that the absense of documentation blocks the release of the actual code. |
Hi @catamphetamine, The code was released in v6.3.1. I hope that helps, thanks! With Best Regards, Elmer |
@thinkingserious Oh, cool, actually it didn't cross my mind to update the version of the library. |
Note to users: when using templates pass |
Now you have to change "substitutions:" to "dynamic_template_data:" And the templates uses handlebars no more need to specify "substitutionWrappers" |
This example in your use cases still uses substitutions rather than dynamic_template_data. Plz update, it definitely took me a couple hours of playing with the SDK and searching before I found this thread. (Also your api docs don't mention anything about this, which didn't help either. |
My apologies @josh-yonomi, I've updated the documentation based on your feedback. For our new templates, they use handlebars syntax. The legacy templates still work as before. With Best Regards, Elmer |
I receive the email but the substitutions does not work. What can cause the problem?
|
EDIT via @thinkingserious Do you mind letting us know where the problem is? We'd love to understand your frustrations so that we can improve. |
Do you mind sharing what your template looks like? With Best Regards, Elmer |
why do you strip special chars in substitutionWrappers ??
only |
I'm not sure @larafale, but that certainly does not seem reasonable. Looking at the source code for this SDK, I don't see where those keys are getting modified. Do you mind creating a separate issue for this issue and include what your HTML template looks like? I'll mark the new issue as a bug and try to reproduce and fix if necessary. |
Hello, So, I am trying to send a dynamic template email, however, I am not been able to use substitutions or
I confirmed that the Any idea what I am doing wrong? Thanks. |
@gianfelipe93
|
@drav96 thanks mate, it's working now |
Adding what I hope will be some definitive documentation after wasting another hour of my time on this. (First, thanks to everyone who wasted hours of their time before me.)
|
In my case it works with |
Yes, it does work with snake case keys, but it appears as though the devs have committed internally to camel case (see the line I linked to in my report above). Thus, I would recommend all new code use camel case. |
Hello @kael-shipman, Thanks for taking the time to help out, we greatly appreciate it! Did you happen to see this documentation? If not, would you mind describing your path of discovery that led to a wasted hour. I would love for that to never happen again and my apologies for the poor experience. With Best Regards, Elmer |
@thinkingserious , thanks for your understanding and willingness to improve the situation. And sorry for getting snippety up there. Had had a looooooooooooooong day ;). Anyway, the problem is not so much that the correct(ish) documentation exists somewhere, it's that a lot of old documentation is still caught up in Google searches. I did a search for "sendgrid template fields" (just now) and the first non-ad result is this, which by all indications is the official documentation, but is clearly out of date. Not only that, but it also has two different substitution formats ( In my experience with sendgrid, while I greatly appreciate what has been built, this documentation confusion is actually the rule, not the exception. I know it's probably barreling forward as much as the rest of the software world is, but it would be nice to take a month or so to just normalize all the documentation, put version numbers on it, etc., and maybe do something about the top Google hits. Anyway, thanks again! |
Also, the documentation you linked still shows |
Hello @kael-shipman, Thank you for taking the time to provide detailed feedback! With regards to the link you provided, that documentation is in reference to our SendGrid SMTP API, not the SendGrid v3 REST API which this SDK supports. That said, you should not be expected to know that. I'll bring this issue to the attention of our documentation team to see if there is a way to make it clear. We just recently updated and re-launched our open sourced documentation. I hope you find it easier to navigate. I will fix the README to use camelCase for consistency. Thanks for catching that and bringing it to our attention! Thanks again and as a token of our appreciation for your detailed feedback, we would like to offer you some swag. Enjoy! With Best Regards, Elmer |
Hey cool, thanks :D
…On Tue, Sep 18, 2018 at 6:09 PM Elmer Thomas ***@***.***> wrote:
Hello @kael-shipman <https://github.com/kael-shipman>,
Thank you for taking the time to provide detailed feedback!
With regards to the link you provided, that documentation is in reference
to our SendGrid SMTP API, not the SendGrid v3 REST API which this SDK
supports. That said, you should not be expected to know that. I'll bring
this issue to the attention of our documentation team to see if there is a
way to make it clear.
We just recently updated and re-launched our open sourced documentation
<https://sendgrid.com/blog/how-to-get-the-most-from-sendgrids-new-knowledge-center/>.
I hope you find it easier to navigate.
I will fix the README to use camelCase for consistency. Thanks for
catching that and bringing it to our attention!
Thanks again and as a token of our appreciation for your detailed
feedback, we would like to offer you some swag
<https://dx.sendgrid.com/swag>. Enjoy!
With Best Regards,
Elmer
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#703 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADUIglZIH2d7imy-H7dekTo5A-v2Xau8ks5ucX0agaJpZM4Vev8b>
.
|
I'm able to get |
@catamphetamine Unfortunately, I've downvoted your comment because I've just spent too much time trying to figure out why everybody's code seems to be working with My version: Turns out that for me I had to do the following (the opposite of what people say):
@thinkingserious love the tool. Please continue to improve the docs, cover edge-cases, etc. 🎉❤️ UPDATE:Thanks to @catamphetamine downvote. It got me thinking that may be UPDATE 2:Regarding the types available. I found
Then I stumble upon the following 2 types:
Finally, I get
@thinkingserious Clearly, there are type definition issues which need to be fixed. I may create a PR later. |
Ok, I need to investigate again. I'm stupefied because now neither UPDATE: |
This was an important point for me. I was trying to set subject in transactional template different for to vs cc emails. It worked when I put the dynamic_template_data property inside the personalization array as per above.
|
The solution that worked for me is placing the dynamic_template_data inside the personalization object in the exact way seen below:
|
Issue Summary
On 7/24/2018, our team publicly launched dynamic content for transactional templates. It is now available for all customers sending over v3 of our Mail Send API. Iterate over lists, handle conditionals and more, thanks to native support for a subset of Handlebars syntax!
More information can be found in our blog post announcement.
You can currently use this feature by manually creating the request body as shown here.
Now, we need to create helper code (this is complete) and examples for this SDK.
Acceptance Criteria
Documentation
The text was updated successfully, but these errors were encountered: