Adding message body in Sendgrid (custom)

Howdy! I have my sendgrid dynamic templates setup and working ok, where I need to use a dynamic word or two (like user first name). However, I want to make a big chunk of the message body be dynamic, so I am using the “custom data” box to do this. I can see that Bubble sends the info & the text ok, but Sendgrid seems to ignore it and doesn’t sent anything. Any tips or help much appreciated!

Thanks,
Steve.

image

Hey! I found the solution. Hours of trial & error and messing about and googling. Here it is for anyone that gets stuck in the future.

You can’t send multi line inputs to Sendgrid without manipulating two things:

  1. You need to replace the line return (or break) with a space and then a br thing (I can’t type it here or it will just show a line return haha!) and then another space (the spaces are important). (via the find replace function, screenshot below, in the Find box I have just hit the return key - you can’t see it but it is there).
  2. You need to use triple brackets for your variable input on the Sendgrid side so it knows to expect html (just add an other squirrelly bracket to your sendgrid variable on both sides).

Hope that helps somebody and saves them pulling out their hair!

Cheers,
Steve.

@stevoster Hi! Here’s a very quick set of instructions, since I’ve been awake for way too long and need to crash:

  1. Use ‘SendGrid - Send email’ instead of ‘SendGrid - Send email (custom)’ as the action;

image

  1. Create substitution tags in the action for the dynamic data, like this:

image

  1. Add the tags where needed in the template on SendGrid using the handlebar syntax (e.g. {{ FIRST_NAME }}, {{ MESSAGE_BODY }}, etc.).

Bonus advice: look into replacing SendGrid with Loops.

1 Like

Thank you sir!

1 Like

No problem!

This topic was automatically closed after 70 days. New replies are no longer allowed.