sendgrid icon indicating copy to clipboard operation
sendgrid copied to clipboard

Add support for sendgrid template engine.

Open tant42 opened this issue 10 years ago • 8 comments

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.

tant42 avatar Feb 10 '15 20:02 tant42

+1 really useful

nesrual avatar May 16 '15 13:05 nesrual

Can you give an example of how to use it?

Isildy avatar Aug 13 '15 07:08 Isildy

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.

abhchand avatar Mar 09 '16 08:03 abhchand

+1 @abhchand

LaurMo avatar Mar 09 '16 14:03 LaurMo

:+1: Would love to see that

Intrepidd avatar Apr 06 '16 15:04 Intrepidd

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 avatar Apr 08 '16 17:04 tant42

@tant42 I really need this feature, how can I use this?

gkunwar avatar Nov 24 '16 08:11 gkunwar

Anything else I need to fix before this can be merged?

tant42 avatar May 04 '17 05:05 tant42