Clarity

Expand all | Collapse all

How to embed a carriage return in a string?

Jump to Best Answer
  • 1.  How to embed a carriage return in a string?

    Posted 03-31-2011 10:17 PM
    I've been working on a gel script that loops and builds a list of resources into a variable for later inclusion into the body of an email. This is all working fine except I haven't been able to include a carriage return between the resouce names, they come out as one long string.

    Here is an example of some code I've tried
    <core:set value="${emailResNameList + CR + resrow[0]} \n" var="emailResNameList"/> 
    The CR variable is a string where I've just typed a CR into the value. The \n just ends up getting included in the email text. I've tried just typing a return at the end of the string concatenation, breaking the code onto another line. It all runs clean, it just doesn't work.

    So, anyone found a way to include a CR when concatenating a bunch of values?

    Thanks!


  • 2.  RE: How to embed a carriage return in a string?
    Best Answer

    Posted 04-01-2011 03:38 AM
    I've been using the following in a similar use-case;
    &#xA;
    i.e. "AAAAAA&#xA;BBBBBB" comes out in my <gel:email> email as;

    AAAAAA
    BBBBBB


  • 3.  RE: How to embed a carriage return in a string?

    Posted 12-15-2013 08:27 PM

    &#xA; does not appear to be helping me on version 13.2.0.4.

    We already have processes that send email with proper formats.

    After upgrade to version 13.2.0.4, the end-of-line returns are lost.The complete message appears in one line without any carriage return.

    Any suggestion please ?

    Thanks and regards,

    Mayank

     

     



  • 4.  RE: How to embed a carriage return in a string?

    Posted 04-01-2011 11:36 AM
    That's the ticket, works great.

    Thanks Dave, you rock!


  • 5.  RE: How to embed a carriage return in a string?

    Posted 12-16-2013 07:46 AM


    After v13.0 emails can be (i.e. should be!) formatted with HTML.

    So line break is just <br> html.

    There are a few other threads about formatting emails in v13+ - you should search them out.



  • 6.  RE: How to embed a carriage return in a string?

    Posted 12-19-2013 07:43 PM

    I just got around to this issue by using mail:email tag instead of gel:email tag and the emails are now all in expected formats.