问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/56434465/is-there-a-way-to-use-sendgrid-template-versioning-with-different-development-li