-
Notifications
You must be signed in to change notification settings - Fork 322
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 #301
Comments
Please see #300 for WIP |
I'd like to point out the the docs and the article have the |
Hi @metaskills, Are you referring this documentation? If so, it looks like a fix will be deployed soon. Thanks! With Best Regards, Elmer |
Yes, I found that |
Thanks for confirming @metaskills. I'm double checking with the docs team to make sure the fix is deployed. |
Hi all, Has the gem been updated with the new helper methods for dynamic template? I am asking cause I am using gem version 5.2 and I am getting the following error
|
Not yet @heindrik, please follow this page for updates or you can subscribe to our release notification emails here. Thanks! |
For those who want to use helpers for other parts mail = SendGrid::Mail.new
...
personalization = SendGrid::Personalization.new
personalization.add_to(SendGrid::Email.new(email: user_email))
mail.add_personalization(personalization)
...
body = mail.to_json
# TODO: use helper after the issue resolved https://github.com/sendgrid/sendgrid-ruby/issues/301
body['personalizations'][0]['dynamic_template_data'] = {
foo: 'bar'
}
sg_client = SendGrid::API.new(api_key: YOUR_API_KEY).client
resp = sg_client.mail._('send').post(request_body: body)
unless resp.status_code == '202'
raise "Error response from sendgrid API: status_code: #{resp.status_code}, body: #{resp.body}"
end |
I can't understand how it can take so long to release this, specially when the information given is that we are waiting because of other languages. |
Docs are still out of date. I had to search for this PR and https://github.com/sendgrid/sendgrid-ruby/pull/300 this related link to realize I couldn't use "substitutions". How is this a year out of date and not in the docs yet?! |
It blows my mind that a company as large as SendGrid still hasn't updated their docs to reflect this, nor have they updated this gem to work with their new API. |
I think this issue should be closed, dynamic templates work. See https://github.com/sendgrid/sendgrid-ruby/blob/main/examples/helpers/mail/example.rb |
Example here as well: https://github.com/sendgrid/sendgrid-ruby/blob/main/use-cases/transactional-templates.md#with-mail-helper-class Closing. Please open a new ticket to track any additional docs work needed. |
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 and examples for this SDK.
Acceptance Criteria
Documentation
The text was updated successfully, but these errors were encountered: