The isnât working for me because I run backend workflows with the Sendgrid plugin and when the backend workflow is scheduled it just saves to a parameter called, âBodyâ where itâs type is text, and after I put that there is no option to use the method, âjoin with.â
Thereâs a number of ways to tackle line breaks in general. Itâs important to know the structure of data coming in and the structure/limitations of where that data is going. One of the most common issues we end up addressing in Sessions dealing with emails is HTML character formatting.
A simple example to demonstrate text block formatting is the data coming from a multiline input, also a very common instance for message notifications, order notes among other examples:
Copilot offers on-demand assistance, targeted courses
and custom development for all types of projects.
When you punch that raw text into an API request, youâll likely be including the newline character represented by the \n youâve probably seen before in logs, documentations and other sources:
Copilot offers on-demand assistance, targeted courses\n
and custom development for all types of projects.
SendGrid sends HTML emails with templating enabled by Handlebars. The newline character cannot be interpreted by HTML to form a newline, but you can accomplish that with the <br> tag:
Copilot offers on-demand assistance, targeted courses<br>
and custom development for all types of projects.
When the block above is run through SendGridâs interpreter, it can easily recognize <br> (as well as other tags) to achieve the multiline structure. You can handle the swap using the :find and replace module across Bubbleâs native inputs and JSON strings among others.
Line breaks have less to do with the plugin than the data itself. We could explore adding a built-in line break handler in a future update, but weâre definitely believers in configurability over all.
This was my initial thought and I tested it out using a multiline input; however, on my Sendgrid HTML email it returned back with <br> in the body of the text.
Youâre likely not using Handlebars correctly, maybe omitting a bracket/stash. Continuing the example, youâd want to bring everything together into your template using the tag you choose:
Hello, you just received this message:
{{{body}}}
Understandably, body being the formatted multiline text coming from your application. Both SendGrid and Handlebars have sections in their documentations dedicated to escaping HTML. Always be sure to thoroughly explore a service providerâs documentation and syntax prior to making them a dependency in your application(s).
If you feel you could use more assistance around email formatting, you know where to find us.
The error is a User Config / Data Error - So this happens especially when you donât have the correct data being put in.
Have a check of dynamic data. In my case, I was playing around with this but put the receipt as the current userâs email, which was empty as I was not logged in. Once I forced it to a certain email, this was all good.
Hi all, I am using the Sendgrid Copilot plugin in a backend workflow and am repeatedly getting âInvalid SMTPAPI headerâ errors. The error states âThe template id must be a valid template id for your account.â I have double and triple-checked my Dynamic Template ID and it is correct.
Because the backend workflow is triggered the day a Thing is created, but Sendgrid needs to send email at a future date (the day before the Thing expires), perhaps there is an authentication issue?
Should I check off in Bubble: âthis workflow can be run without authenticationâ? or âIgnore privacy rules when running this workflowâ?