Versioning in SendGrid allows API clients to make template requests only by template ID documented here, however, only one version of a template can be "Active" at a time. Obviously, the template used for our production applications needs to always be set to active, but what about adding a new template version we use in an upcoming release? How can I leverage template versions to test this "Inactive" version in our test environment? The issue was discussed here, but it seems to just be closed and lost when you start following the links.
If there is no way to specify versioning, that only leaves a few options that require either creating environment specific templates and having them get promoted to the production specific template once a release is finished, or creating separate accounts for different SDLC environments and migrating them as the process moves forward.
The issue was also discussed here in regards to language versioning, but it really doesn't help my problem.
What is the best practice given the tools provided by SendGrid's API to leverage versioning? Having different SDLC step named template seems like a disaster to maintain with hundreds of templates(let alone multiple for each environment). Managing multiple accounts just seems like a nightmare when it comes to testing when moving to production. Am I just missing something completely obvious here?
Sendgrid dynamic template uses handlebarjs syntax to replace variables with values in HTML. The template contains variables with double curly braces. Below code is converted to html by replacing name with actual value in plain text.
I spoke with technical reps at SendGrid and this feature is not available from their API or UI. Only a single template can be "activated" at a time. You need a separate template for every environment, or the templates need to be managed from your API consumer. If anyone reads this and has questions about different solutions, feel free to post and I'll explain how I resolved this for my application`s needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With