Updating subject line to `{{{subject}}}` in Sendgrid not working

204 Views Asked by At

I am trying to make a call to SendGrid via the Python SDK:

self._sendgrid.client.templates._(template_id).versions._(version_id).patch(request_body=data)

where the data is:

{"name": "this is a name1234.12341234132", "subject": "{{{subject}}}"}

I am getting the following exception:

{'error': 'Cannot update the active version with warnings.', 'warnings': [{'message': 'Failed to validate handlebars'}]}

My goal is to get the subject value updated to use {{{subject}}} as the value, so that we can dynamically set the Subject of the emails based on whatever is calling our function to send the template. I can do this, by manually setting the template versions within SendGrid directly, but trying to use the SDK or API, I am unable to do this. We have a lot of templates and it would take a while to update them all manually. Looking for help.

Solution to the problem I am experiencing when using the Python SDK for SendGrid.

0

There are 0 best solutions below