cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a line break in body email using snaplogic expression

AngeloRAlves
New Contributor

Hello friends!
Does anyone know a way to add some line breakers (\n) into an body´s email?

Example,
_v1+" “+_v2+” "+_v3 has this output:
1 2 3
how can i have this output:
1
2
3

Note- i´ve tried plain and HTML text.
I´ve tried several ways inside Snaplogic’s expressions tool, but without success (\n is simply ignored).
Any hint is welcome, even if i have to add other snaps.
Cheers!

4 REPLIES 4

ljupcho_machko1
New Contributor III

Hello @AngeloRAlves ,
You will need to use <br>. below is given one example, which I think can help you how the expression can be composed correctly:

image

darshthakkar
Valued Contributor

Agreed with @ljupcho_machkovski.

@AngeloRAlves - Please write a html script in the email sender snap and put the tag as <br> for line breaks.

image

vinnakotak
New Contributor

Can someone please suggest how to add line break in Plain test email?

Thanks

The following worked for me using the Email Sender snap with Plain text for the body:

$body = "This is a test body.\nThis is a line after a line break."

$body.replaceAll('\\n','\n')