Having trouble with Sendgrid Emails


In my app, I want to use sendgrid to send emails which have buttons.
If they press a particular button on their email, it should navigate them to a particular page.

I have created a sendgrid account, created an email template and inserted my SendGRID API key within Bubble.
Within Sendgrid, I have an email template as seen below:

Back on bubble, how do I correspond the body tag to the text I want?
In addition, how do I control the button.
I have this workflow and am slightly clueless and unable to find any guides on using sendgrid templates.
Any advice greatly appreciated.

You can just keep things really simple and use the standard Email > Send Email workflow. If SendGrid is properly set up in your bubble editor’s settings… it will automatically use that SendGrid template.

Anything you put in the body of the email (in the workflow) will appear in the <%body%> tags of the SendGrid template.

unfortunately, I know I need a few variations of emails,
the main thing is some emails will contain buttons and some will not (depending on user journey’s / workflows).
Am I doing something totally wrong?

I wouldn’t have thought you were doing anything wrong. I’m no expert and the only reason I responded was because I found myself in a similar situation a while back.

In the end, I just cut everything down to the basics and had a simple “Login” button at the bottom of the template for users to login.

If I wanted users to activate a certain workflow (following a certain e-mail) I would provide a link in the body of that email that directed them to a certain page within my bubble app, that would then activate those workflows once the user has selected it. (User has to login again though).

Hope this makes sense, but like I said, I’m no expert and maybe someone can offer better advice.

1 Like

yeah - I may have to re-jig my app to do this if no one else replies :confused:
so in your sendgrid - do you have just 1 single template
with %body% tag which pulls up whatever the body you have defined in your bubble app?

Yes, that’s correct. Just one simple template with everything I need in the body of the email workflow.

so I now just have 1 template in my sendgrid.

In my bubble app, I am sending emails (through sendgrid) which I can confirm in my actual email.
THis is the workflow:

However, in my email, the image does not appear at all.

Any advice on this?

If the image is with SendGrid, most likely the problem is with them? Or with where the actual image is being hosted?
Or maybe the email client you are using? I know Microsoft stop certain images from being displayed in emails unless you have ok’ed it? Other than that, not really sure. Haven’t had any probs myself with images not being displayed in my SendGrid template.

image hosted on sendgrid,
email client is Gmail (it also says sent via sendgrid)
going to leave it for now and come back tomorrow

@mikescullion - when you are getting users to trigger a specific workflow from an email, how are you sending the data through the email?
is there any chance I could have a look at your workflow? (after a user clicks the link on the email)
how are you triggering a certain action from the email (are you sending something within the email itself?)
Cheers for all your help

Well, bear in mind that this is just a work-around and may not necessarily be the correct way to do this – nor work in everyone’s case. It’s just something that works for me.

Technically, I am not triggering any workflow in the e-mail. I am sending the user a specific email based on a condition.

There can be several e-mails and only the email matching the condition you have set will be sent.

In that specific email’s body, I have a link to a page. That page has purposely been build for this action. So when the user clicks the link (and logins) it will activate the desired workflow using that page. Does that make sense?

I can’t share I am afraid, as it’s technically not mine to share.

HI @alex8
To add a link behind your SendGrid button:

  1. In your Bubble workflow, in the SendGrid step (= your 2nd screenshot), choose any variable, let’s say “(body) VAR1”, and insert the URL to the page you want the user to go to (either directly or insert dynamically)
  2. In SendGrid, put “%VAR1%” in your button URL


If you wish to customize your button text, you could use an other variable there, eg:

  1. Bubble: “(body) VAR2” => “Click here [name]!”
  2. SendGrid: Button text = %VAR2%

NB: this would also work with text links :wink: I use this, for example, for Twitter handles where the Twitter handle is a first variable (VAR1 = @username = %VAR1%) and if you click on it, the link behind is a second variable (VAR2 = profile URL = %VAR2%)


So i found a pretty long solution for multiple sendgrid email templates.
You can find it here: Email with button to dynamic URL from Bubble

ahhhh i wish you showed me this early, i ended up using the Bubble API Connector and building it out in JSON ahah god damn it

Very useful info. Thank you.

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