Sending Bubble emails using a SendGrid Template

I am trying to make my transactional emails pretty (emails created using ‘send email’ action in workflows)

I have created a dynamic template in SendGrid and added this number in the ‘Template ID’ field in Bubble’s Email Settings.

However, while Bubble is succesfully using the template in SendGrid, there is no data in it - no subject and no body. How do I add this to the template in SendGrid, I presume it is some kind of shortcode?

1 Like

Hi @tristan.adlington

Did you work out how to do this?

Thanks

I haven’t unfortunately - have you?

I imagine it is very simple - add some kind of tag for subject and body to the template in SendGrid.

No, for the moment I am using the rich text editor to create emails the best I can.

You are supposed to use Send email (custom) action to send data with JSON.
Capture

You select Dynamic for type and paste your Template ID from the sengrid.

Then in the custom_data box, you can feed dynamic app data to the email template by using JSON.

Then in your Sendgrid template, make sure to have {{subject}} in your Subject line, so that the subject data comes from your sendgrid custom email action.

As you can see, in the email template itself, I used {{name}} to pull the right data to the right place.
Capture4

I hope this helps.

12 Likes

As a quick note, @ferhatgulbahar (great walkthrough!) is using the SendGrid plugin as opposed to Bubble’s built-in email actions. You’ll have to decide which option works best for your use case! :slight_smile:

4 Likes

Thanks a lot @ferhatgulbahar. Yes it definitely helps a lot. I will definetly upgrade at some point to using Sendgrid templates, but before I do I have a question…

@copilot, from your remarks, do you also mean than we can use json with the Bubble built-in email actions or are these the limitations that exist with using this option?

Thanks

1 Like

Hey @mangooly,

We created the SendGrid plugin to get around some of the limitations with Bubble’s option. :slight_smile:

1 Like

@ferhatgulbahar How can one set up a SendGrid template to be used in Bubble’s automatic transactional emails such as password resets and such?

I’ve created a new template in SendGrid, entered its ID in Bubble in Settings > Domain / email > Email settings > Template ID, and verified the API key.

However, no matter where I add <%body%> in the template (as per Bubble’s documentation), dynamic content of the email never displays when an email is sent, only static stuff like the logo image I put in there.

1 Like

Are you using a dynamic template within SendGrid?

@SerPounce I am. I can get a Legacy template to work as a catch-all template, but not a Dynamic one. Do you know how to do it?

I spent the entire day yesterday going through this and pulling my non-existent hair out. In the end, I was causing my own troubles as I was using a bunch of out of date forum posts and tutorials. At the end, I followed this and it worked first time:

The way to know that this is the current version is reference to these keys or substitution tags. The outdated posts refer to all manner of obsolete stuff that is such a rabbit hole. That should all be sunset.

4 Likes

There’s no need to use a plugin if you use legacy templates on Sendgrid. This should help:

[Beginners Guide] to Sending Emails With Sendgrid - Work in Progress! - Tips - Bubble Forum

When you create a new template a default body HTML tag will appear on the page. Build your template around this and don’t delete. Save.

Then add the template ID in to Bubble’s settings. The body configured in the workflow will appear where the html tag is in the email template.

1 Like

@jason.thomas89 and others…
Do you mean that Bubble’s inbuilt Send Email action only works with Legacy Templates in Sendgrid?

Hey @will_ericksson,

This is true, if you want anything with the new version of email templates you’ll need to use the @copilot Sendgrid plugin or setup a connection on the API connector.

2 Likes

@johnny thanks for verifying.

What do we do if we wasn’t to have more than one template? Bubble only has space for one template ID

Hey there @darren.james7518,

I’d use the Sendgrid CoPilot plugin. But in all honestly I wouldn’t even use Sendgrid considering their terrible delivery rate.

hmmm, I must admit Sendgrid is annoying. Or maybe it’s Bubblle which is the issue? I always get this error, even when my Subject is plain text. My tests work, meaning Sendgrid is sending emails and they are arriving, but when I set up a button in Bubble to send email I get the same error.

error

@darren.james7518 I ended up ditching Legacy Templates and exclusively using Dynamic Templates in all new projects, powered by @copilot’s excellent SendGrid plugin. I can’t recommend it enough.