-
Notifications
You must be signed in to change notification settings - Fork 108
Add support for sendgrid template engine. #23
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
base: master
Are you sure you want to change the base?
Conversation
…dency from gemspec.
|
+1 really useful |
|
Can you give an example of how to use it? |
Add support for sendgrid template engine.
|
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 It's also worth noting that there's been an almost identical PR to add this same functionality open for even longer, since 2014: #19 Thanks. |
|
+1 @abhchand |
lib/sendgrid.rb
Outdated
|
|
||
| # Call within mailer method to set the template_id. | ||
| def sendgrid_template_id(template_id) | ||
| @gs_template_id = template_id |
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.
Typo - should be @sg_template_id everywhere in this file
|
👍 Would love to see that |
|
Pull request has been updated with test to demonstrate usage. (Basically in the mailer function you need to call: 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? |
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.