-
Notifications
You must be signed in to change notification settings - Fork 781
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
How to iterate array of objects in Sendgrid template? #221
Comments
Hello @sabapk, Please open a ticket at https://support.sendgrid.com. Thanks! |
is this supported yet by the templating engine? |
I'm checking with our product team for an update, thanks! |
This is on our radar for implementation, but there is no estimate on timeline yet. |
Ok thanks for the update. I guess a work around would be to generate the looped HTML manually and pass that in as a substitution. Crude, but it would work. |
@thinkingserious I am subscribed to this issue. Is there another way I could subscribe for notifications about iterator implementation in sendgrid templates? |
Hello @eupharis, Please make sure the email you have in your SendGrid account settings is up to date. We send product announcements to that email address. Thanks! Elmer |
Hi @thinkingserious |
Hi @free4ride, There is still no estimate on timeline yet. The best option to be notified of any updates on this issue is to make sure the email you have in your SendGrid account settings is up to day. Thanks! Elmer |
As @adamreisnz commented, sending the array in as a HTML might work, however we are experiencing problems with the substitutions being too large, exceeding 10000 bytes |
Sendgrid, I thought, was a pretty good alternative to Mandrill. No looping? That's actually ridiculously surprising from such a large service.... It's impossible to even create a checkout order success form, because you need to loop through the items purchased and display them. Oh well, another one down. |
Hello @stephengardner, Have you tried using substitutions with our templates? Check this out. If that does not fit your need, let me know and I'll try to figure out how to help you achieve the results you need. Thanks! With Best Regards, Elmer |
Substitutions don't work for listing a table of purchased products for example, because they can only replace one value, and not an array of values, let alone an array of objects with more detailed values. What we need is support to loop through products and have a template for each product that then gets repeated depending on how many products you supply for the substitution. The only way around it is kind of half-baked -- you'd have to generate the HTML on the server, and send that whole chunk of HTML as a single substitution. Clearly that is not ideal as you then have part of the layout sitting in server side code instead of nicely in the online template where designers can edit it. I do agree that this is a major item that's preventing us from using templates as well. As such, we have templates on our server and process them there using handlebars, which does support looping, if statements, etc. We then just send the entire HTML out as mail body, which is a bit of a waste of resources. |
Thanks @adamreisnz, I have reached out to the product team that owns this functionality. I will update this thread when I learn more. With Best Regards, Elmer |
Hi @stephengardner, @adamreisnz, Your votes have been added to give this feature higher priority for implementation. Please make sure the email you have on file for your account is up to date, that is how we would notify you of the implementation of the feature. With Best Regards, Elmer |
I would like to vote up this feature too. This is a must for you system. Thanks ;) |
Completely agree. Up-vote from me and my team! Please add this feature asap. |
Thanks @free4ride, your vote has been added. |
+1, I was surprised to find this is not implemented yet, I assumed iterating would work. Add my vote please. |
+1! Iterators would be awesome!! |
Any ETA on this? It is ridiculous that this feature hasn't been implemented yet. Right now we are generating the email body on the server and it is getting rejected by sendgrid API because it is over the substitute limit. |
@thinkingserious any update on this? We're likely to move off of Sendgrid in the coming week if there's no affirmative movement on it. We can't afford to compromise the quality of our emails because a standard feature like this isn't supported by a large service. |
The fact you don't have this is a complete a utter joke. |
You vote has been added @9mm, thanks! |
Hi @thinkingserious, thanks for a great service, what is the progress of this? You would be so much more awesome if you can add e.g. Handlebars support without forcing your clients to use an external webhook service like Sendwithus. Thanks |
I´m interest in this too!!! |
WTF is wrong with you guys. I wish I read this before signing up for SendGrid. How has it taken you OVER TWO YEARS to implement such a basic feature! |
We have decided to switch to Mailjet, which does support features like (multi-dimensional) looping, if-statements, variables and some functions for dynamically generating blocks, with a Node.js-wrapper on Github as well. The development of this feature takes way too long. |
Thanks for all of the additional votes to get this completed, we can't wait for this to be released also! This feature is already in active development and if you would like to be added to the beta, please send an email to [email protected]. Thanks! |
@thinkingserious and it's looking good! :) |
The turn of the corner seems too far away! I'm waiting too |
+1 need this as well |
Definitely +1 - on the verge of switching to another provider just because of this feature. |
We will also be emailing @ben-grid to get on this beta. +1 |
Can't believe it doesn't have such a basic feature. |
It looks like in the beta, this feature is now there under "transactional" templates. The old templates seems to have been renamed to "legacy" How do I access this via API @ben-grid , do we have docs for this? The 3.0 API does not seem to have it. Thanks |
+1 |
Hey all, I just wanted to give an update here. First of all, A BIG thank you to everyone who has participated in interviews and the beta program. Your feedback has been invaluable! Second, thank you to EVERYONE on this thread for your patience. I've read all of your comments and, candidly, your frustration is completely understandable. You've waited a long time for a very critical feature and I couldn't be happier that we are finally closing that gap. If you don't have access already and need it, shoot me an email @ [email protected] to get into the beta. We'll also be rolling this out to ALL users just around the corner, and I'll update this thread soon with a firm date. Thanks again, you all rock! |
Hi @ben-grid I've emailed you to get access to the beta but I'm not getting any replies. Is there any way we can get access to this asap? We would really like to use sendgrid as our e-mail engine but this is blocking us... |
@ben-grid same here 👍 Please let us know when we would be able to get Beta access. |
2 years and still not implemented. |
Hello @catamphetamine, This feature is hitting GA very shortly. If you would like beta access prior to that, please reach out to [email protected]. Thanks! With Best Regards, Elmer |
Hey all! Great news–– Dynamic content for Transactional Templates is here!This morning, 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. Documentation: Thank you, on behalf of the entire SendGrid team, for all of the feedback throughout the beta program. 🙌🏻 |
Great news, good work team 💯 |
This dynamic template stuff is great. Nice work and great timing for us :-) |
data--
|
Thanks, bro that was really helpful |
Hi! Is there any way to have iteration inside iteration? |
yes nested iteration is possible {{#each innerarray}} {{/each}} |
Thanks a lot for this. It helped me so much |
Hello, token-appsolzone Please help me Please create send grid code for this data |
Any update on it. |
Mandrill provides support for Handlebars template and so looping is supported. As I read, Sendgrid doesnot support
each
like directive. So how do the sendgrid users tackle this shortcoming?I want to loop through the products, as shown in below object.
The text was updated successfully, but these errors were encountered: