Forum Academy Marketplace Showcase Pricing Features

Sendgrid #each iterations with bubble

Hey bubble community,

I have built a custom table email in Sendgrid that I am hoping to populate with data from my bubble app using Sendgrid’s iteration syntax.

The email is working with the test data however I can’t get it to work with my bubble API requests. Any help would be greatly appreciated.

Here is the table code:

And here is the test data that it works with correctly:

Here is how it looks in an email:

And finally here is how I am currently configuring it in bubble:

image

I have also tried hard coding the data to see if it works and it doesn’t (although I could be setting this up wrong by using arbitrary text):

image

As I said any help would be greatly appreciated!

Just to test, in your hard coded screenshot, keep it all the same but delete the slashes in the date, see if that works.

@tylerboodman Didn’t think of this - good idea. But unfortunately didn’t seem to change the outcome.

Yea sorry not sure, any errors coming from the plugin in the logs? Possibly a formatting issue…

No error. Looks to be formatting properly too:
image

Just not sure how it is being receive by sendgrid and if it is adding the {“upcoming”:[xyz]} around it. I tried adding it in manually but still no success.

Have you tried formatting it as JSON Safe?

@adamhholmes Yeah I tried this prior and didn’t seem to work. Could be configuring it wrong though. I did see this in the documentation:

Here is the log without changing my text input:
image

Here is the log where I’ve removed all quotations/brackets:
image

:formatted as JSON safe adds in the quotes around it, so you would want to do that after each of the dynamic parts in your Formatted as text operator. And remove quotes only around those dynamics parts

1 Like

You probably also need to change your handle bar in the Sendgrid template to the ‘triple stack’ version…

i.e. {{{ data }}} instead of {{ data }}

@tylerboodman Thanks for the tip. Here is how I configured it:
image

Here is the log:
image

Still not working on email however (is ‘null’ an issue?).

@adamhholmes this didn’t seem to work. Also it stopped working with the Sendgrid test data after this:

Remove the spaces (just a guess :laughing: )
Or the data is empty you’re filling in?

I’ll try anything at this stage haha. Unfortunately didn’t work:
image

The logs is showing data coming up so I don’t think it is empty.

Yea that :null is probably your issue, probably is breaking the formatting since it’s not in quotes and not escaped. Not sure what that is about but it’s coming out of the :JSON safe operator…

Try different date format with dashes instead or someting?

Added a constraint to the list to only include items that have a date data entry. Still not working
image

Is there any way in Sendgrid to see what has been received or how it is using the data in the email template code?

Not sure, usually an API responds with what it doesn’t like and it’s visible in the Bubble logs.

You could try doing all of this from Postman so at least it’s a little easier to debug.

Time to move to Postmark for emails :slightly_smiling_face:

Sadly we’re not as nimble at this stage. Our whole platform with all our other emails are integrated with sendgrid. Thanks for your help tho @tylerboodman

Yea it was worth a shot :laughing:
If anything comes to mind with this issue I can reply back but maybe some SendGrid experts will see this post

1 Like