Forum Discussion

AngeloRAlves's avatar
AngeloRAlves
New Contributor
3 years ago

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

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

  • ljupcho_machko1's avatar
    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:

  • vinnakotak's avatar
    vinnakotak
    New Contributor

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

    Thanks

    • bgoodkinTCF's avatar
      bgoodkinTCF
      New Contributor II

      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')