Send Beautiful HTML emails from Bubble Through API connector

Hey Bubblers,
If you want to send beautiful HTML emails you can do so through Sendinblue using Bubble’s API connector. Here are the steps.

  1. create an account with Sendinblue
  2. create an Html template (you can use one of the services like https://www.inkbrush.com/ that allow creating beautiful responsive HTML templates based on your design files)
  3. if you want to have dynamic attributes that should be replaced with data from Bubble put in the HTML in this format %FIRSTNAME% (must be capital letters)
  4. install the API connector plugin in Bubble
  5. setup the API call as shown on the screenshot below
  6. replace 5 in the URL with your template ID
  7. replace dynamic attributes with your own ones (if it’s an array of attributes use the syntaxis as [{“FIRSTNAME”:“attr1”},{“LASTNAME”:"attr2},…etc]
  8. replace the api-key with your key (you can get it from sendinblue dashboard)
  9. when you use this call as an action in the workflow, you’ll be able to replace any body parameter with Bubble’s dynamic data.

Thanks,
Levon.

Founder at Bubblewits - Bubble Certified Partner

http://iambubble.com - one page Bubble demo
http://builtonbubble.com - Collection of apps built on Bubble
Dev.zeroqode.com - Reach out if you need help creating something on Bubble

31 Likes

Awesome!

1 Like

Thanks @levon

1 Like

Your a good man!!!

Great thanks

For this step:

  1. if you want to have dynamic attributes that should be replaced with data from Bubble put in the HTML in this format %FIRSTNAME% (must be capital letters)

Does this go inside the code for the email template inside of SendInBlue?

How do I add the ‘text’ parameter to this?

Everytime I do I seem to break something and the call doesn’t work…

so in the html template in sendinblue you only need to specify the variable which in our case is %FIRSTNAME%

then you configure the API call as shown on the screenshot.
the way it is on your screenshot should work, doesn’t it?
only that if you want to have a dynamic value instead of Justin, then in the workflow when you call this api you can remove Justin and insert a dynamic expression there, make sure you keep the " before and after that value
Does this answer your question or misunderstood it?
Levon.

Founder at Bubblewits - Bubble Certified Partner

http://bubblestore.io – a place to buy Bubble templates for landing pages, workflows etc.
http://iambubble.com - one page Bubble demo
http://builtonbubble.com - Collection of apps built on Bubble

1 Like

Ok so the %FIRSTNAME% goes inside the sendinblue template. Got it.

But what about the main body content of the Send In Blue Email where it should be dynamic to content that is within Bubble? How do we add a paramater or something so that it works? When I view their docs and add in the ‘text’ paramater it breaks the call entirely and can’t seem to figure out how to set it up in addition to the other parameter there already (for to: and name:)

what other parameters you are trying to use? can you show some screenshots?

What I’m trying to do is send out a list of newly added Things on a weekly basis.

Those Things must all be dynamic so I’m trying to figure out how exactly to call those Things into the body of the sendinblue template dynamically.

I am assuming that I need to include more parameters from https://apidocs.sendinblue.com/tutorial-sending-transactional-email/

HTML + inline image are the two that I’m trying to add so that these can be dynamically added by Things in Bubble.

In the action section this is what I currently see and I’m trying to figure out how to add more content to this dynamically.

This is what I have in the configuration section and when tested it causes an error:

I assume that if i configure it like this then i’ll be able to add some html dynamically or call things from Bubble to the template?

I see now, you are right, you would need to add more parameters in the Sendinblue template. For example %PARAM1%, %PARAM2% etc…
then in the API connector you need to list all these as follows
{
“to”:"justing@gmail.com",
“attr”:[{“FIRSTNAME”:“Justin”},{"PARAM1}:“something1”},{“PARAM2”}:“something2”}]
}

Will these settings work for anything we want to call? Including images?

I assume that the image source URL will need to be replaced with one of the PARAMS?

not sure, you would need to experiment with it…

Thanks,
Levon.

Founder at Bubblewits - Bubble Certified Partner

http://bubblestore.io – a place to buy Bubble templates for landing pages, e-commerce, workflows, APIs etc.
http://iambubble.com - one page Bubble demo
http://builtonbubble.com - Collection of apps built on Bubble

I contacted their support. Send In Blue does not allow it.

Thanks Levon!
Works great when I only have one attribute, but when I try to use an array, I get an error message.
The message “unable to do request, please try again later”. Have you encountered this?
This is the body:
{
“to”:"test@test.com",
“attr”:[{“FIRSTNAME”:“attr1”},{“BOOKINGID”:“attr2”}]
}
Is there something wrong with how I’ve set it up?

EDIT: Figured it out. The array should be set up like this:
“attr”:{“NAME”:“His name”,“PRICE”:“This is my price”}

1 Like

awesome @pnodseth thanks for the edit, it’s very helpful!

This is an awesome post! Thanks for the contribution.

Do you think this could be done with MailChimp as well? and if so, why did you choose sendinblue over mailchimp?

MailChimp doesn’t allow transactional emails (emails sent upon user’s actions, e.g. to confirm something) - it’s only for mass emails like newsletters etc.
They have a service called Mandrill for transcational emails and it was quite popular but recently they have ceased their free plan which allowed up to 12 000 emails per month. That’s why i have chosen Sendinblue which still has the free tier.

Thanks,
Levon.

Founder at Bubblewits - Bubble Certified Partner

http://bubblestore.io – a place to buy Bubble templates for landing pages, e-commerce, workflows, APIs etc.
http://iambubble.com - one page Bubble demo
http://builtonbubble.com - Collection of apps built on Bubble

Why SendInBlue and not SendGrid? They allow it, 12 000 per month.

Just curious.

1 Like

Both have the same free tier and both are possible of course. In this particular example it’s SendinBlue.
Bubble integrated Sendgrid, check out this thread [New Feature] Using Sendgrid for emails

Thanks,
Levon.

Founder at Bubblewits - Bubble Certified Partner

http://bubblestore.io – a place to buy Bubble templates for landing pages, e-commerce, workflows, APIs etc.
http://iambubble.com - one page Bubble demo
http://builtonbubble.com - Collection of apps built on Bubble