Hi there, I have a really basic question, I think. How to separate rows inside an email content.
A pretty simple Scenario with 4 steps:
- Get weather forecast from the weather app (for 3 days)
- Text Aggregate them into one text SEPARATED by LINES
- Set a Variable with the text
- Send text by email
Scenario
The Text Aggregator seems to be separating the rows correct:
The input of the email looks OK, separated by rows:
This is the Email module, taking the data from the variable (I also tried taking directly from the text aggregator and got the same result as below)
All working well besides the fact I’m getting the text by email like this:
Oct 13 : Min: 16.11 - Max: 19.54 Rain (moderate rain) Oct 14 : Min: 14.74 - Max: 24.09 Clouds (overcast clouds) Oct 15 : Min: 17.01 - Max: 25.91 Clear (sky is clear)
whereas the desired result would be like this:
Oct 13 : Min: 16.11 - Max: 19.54 Rain (moderate rain)
Oct 14 : Min: 14.74 - Max: 24.09 Clouds (overcast clouds)
Oct 15 : Min: 17.01 - Max: 25.91 Clear (sky is clear)
any thoughts on how to fix?
This is a commonly-asked question.
You’ll need to send HTML, not plain text as output by the Text Aggregator.
To do that you need to use a Text Replace module to add paragraph tags to the start and end of each line before you can use it in the email.
Original string:
Output, HTML:
For more information on how to do this, see https://community.make.com/t/how-to-start-a-new-paragraph-adding-signature-in-email/16781/2 and https://community.make.com/t/claude-gpt-new-line-outputs-for-html-email/16805/2
3 Likes
Thank you @samliew your direction and example solved the issue and I will mark it as solved !
I’m adding the module that solved the issue below.
IF you can explain the syntax as a bonus step it would be great, because I simply copy/paste without really understanding what it means:
Pattern
New Value
Text
2 Likes
Sure, the pattern is basically replacing
-
Unlimited spaces before
\s*
-
As many newlines and carriage returns
[\n\r]+
-
and unlimited spaces after
\s*
With a closing paragraph tag and a new paragraph tag (see “New value”). So,
abc
def
ghi
becomes
abc</p>
<p>def</p>
<p>ghi
But those are all replacing newlines in-between each line, so you still need a starting paragraph tag and closing paragraph tag for the first and last line. Hence putting it here:
so you get
<p>abc</p>
<p>def</p>
<p>ghi</p>
5 Likes
Thank you @samliew I need some time to digest it, seems a bit complicated
All good, there are no silly questions here, so if you have any further questions about the pattern or why it is done this way instead of another you thought of, just ask!
Here are more resources to learn about regular expression patterns:
Hope this helps!
2 Likes