sendgrid
sendgrid copied to clipboard
Add support for sendgrid template engine.
Added support for sendgrid template engine by allowing us to enable it and adding a function to set the template_id.
Remove redundant json dependency from gemspec.
+1 really useful
Can you give an example of how to use it?
Is there an update on this? It's been open for over a year now and is a pretty core part of the API.
Also several people are migrating over from Mandrill to SendGrid given the recent news with Mandrill/MailChimp, so this is a critical requirement for newcomers. Not having the template feature available is definite deal breaker for those of us who store all our email templates vendor-side.
As for the requested example - the author should definitely be on the hook for filling out a description and example, but in this particular case the usage is almost identical to the other X-SMTPAPI functionality this gem provides.
It's also worth noting that there's been an almost identical PR to add this same functionality open for even longer, since 2014: https://github.com/stephenb/sendgrid/pull/19
Thanks.
+1 @abhchand
:+1: Would love to see that
Pull request has been updated with test to demonstrate usage. (Basically in the mailer function you need to call:
sendgrid_enable :templates
sendgrid_template_id <the template uuid>
Use sendgrid_substitute to provide template values.
There's also a bit that's undocumented, but the only way I could get a template item to send correctly is with set the mail options "to" to "[email protected]" and use sendgrid_recipients to set who the emails send to. Otherwise, "to" person is set as the recipient for all people in the sendgrid_recipients list (at least when I first implemented this. That might have been fixed by now).
@tant42 I really need this feature, how can I use this?
Anything else I need to fix before this can be merged?