I’m triggering a transactional email via the SendGrid API but cannot get the section and substitution tags to populate in the SendGrid template (i.e. test that dynamic data generated in Bubble is populated in the SendGrid email template when being sent out). I’ve tried everything (including enclosing the section tags in the personalizations header). Here is my current setup in Postman:
The call works correctly and does send the email with the correct “from”, “subject”, and “to” fields. The section and substitution tags do not work at all. Any ideas?
The docs suggest that sections (not “section”) is at the same level as personalizations, rather than inside it.
Also, substitutions is supposed to be inside personalizations.
Feel free to take advantage of CoBubble’s SendGrid plugin with support for templates and substitution tags via the latest Web API v3. Customizing SendGrid can be a pain but can yield beautiful results. With clients such as Uber, Airbnb and Spotify, you should consider ‘less than ideal’ documentation as a great way to challenge your comprehension just like the engineers at those great companies did.
For anyone interested, here is my API call to Sendgrid for inserting dynamic data into a template using Bubble’s API Connector. The issue I was having before had to do with the sections and substitutions tags - if you just want various %tags% substituted into your SendGrid template, you should just use substitution tags.
Here is my template, just pop it into the API connector. I always prefer to make my own API calls so I can update and control fine details. It works and I have it live, just be sure to put the variables (%variable1%, %variable2%, %variable3%, etc.) exactly as typed into either your html code or directly type it into Sengrid’s Editor.
1. Use these for your headers (put your API key after “Bearer”):