Paragraph Field Data into Body of Email

Hi All,

I am having a paragraph field where the field will be populated with the data, which comes as a template content. Now user can edit some of the Content in the screen and click on send Email,

 

Now the Body of the email would be updated data in paragraph field.

 

Eg: data which comes In Paragraph field

ABC

After editing

ABC

THis is sample

Thanks and regards,

Harsha

 

Now when I show it in body it is changing to

ABC This is the sample thanks and regards, Harsha

It is coming on a single line rather than in the lines specified in the Paragraph field

 

Is there any where to retain the same format as is....

Please suggest

Harsha :)

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to harshav

    You probably want to make an expression rule which you can pass any text through when using in an email, as email text has its own special quirks as well as HTML formatting.

    I've used the following expression rule for a long time now and it's worked well.  It replaces regular line breaks (char(10)) with "<br/>" tags, replaces secondary line breaks (char(13)) with null, and replaces "&", "<" and ">" with their HTML equivalents, to reduce the risk that they cause issues when entered by a user.

    reduce(
      fn!substitute,
      trim(ri!input),
     
      merge(
        {
          "&",
          ">",
          "<",
          char(10),
          char(13)
        },
        {
          tohtml("&"),
          tohtml(">"),
          tohtml("<"),
          <br/>,
          ""
        }
      )
    )
Children