Sendgrid-python: Support for dynamic_template_data

Created on 12 Jul 2018  路  6Comments  路  Source: sendgrid/sendgrid-python

Issue Summary

Handlebars-style template support is in beta. Believe there will be some changes needed to support the "dynamic_template_data" parameter.

Details on API can be found here: https://sendgrid.com/docs/User_Guide/Transactional_Templates/how_to_send_an_email_with_transactional_templates.html

Mostly opening this issue to find out if there's already any work in progress on this, or timeline to support.... can anyone advise?

Technical details:

  • sendgrid-python Version: v5.4.1
  • Python Version: 3.7
hard help wanted help wanted community enhancement up for grabs up-for-grabs

Most helpful comment

Hi @stevenatciklum!

Yes, we are planning to update all of the SendGrid SDKs to support this feature. We just have not posted the issues yet.

This implementation can be used as a guide.

Thanks!

With Best Regards,

Elmer

All 6 comments

Hi @stevenatciklum!

Yes, we are planning to update all of the SendGrid SDKs to support this feature. We just have not posted the issues yet.

This implementation can be used as a guide.

Thanks!

With Best Regards,

Elmer

Unless I'm missing something this is rather trivial! I need to look into the documentation some more (there are a few gaps given how new this is), but we have a working implementation which simply mimics how subsitutions are treated?

We've simply updated the Personalization helper to include a _dynamic_template_data exactly the same as _substitutions. You can even get away with using the Substitution helper to apply _dynamic_template_data (obviously a temporary hack) - but I haven't tested this with list data...

Anyway, perhaps a PR would help show you the approach we've taken?

I've just put this together as an example of what we're doing - by no means fully tested: https://github.com/sendgrid/sendgrid-python/compare/master...workshoptech:master

That's awesome @djw27!

I've updated the acceptance criteria to clarify what we need here.

For continued progress, please follow this issue instead.

Thanks!

Once that issue comes up on my backlog I'm going to dig into your solution @djw27. Thanks again!

@thinkingserious great - I think my solution fits the acceptance criteria. I'd like to add some test coverage before submitting a PR however, will try find time!

Thanks @djw27!

Was this page helpful?
0 / 5 - 0 ratings