Clarity

 View Only
  • 1.  Gel - email: add line break or carriage return

    Posted Aug 23, 2010 12:37 PM
    I know how to send an email via gel. I wrote a query and received the results. Does anyone know how to add multiple lines of text to an email?

    In other words, I would go through the data set and add parts of the results to the body of the email address.

    My issue being encountered right now, is that I don't know how to add a line break.

    Thanks

    Aaron


  • 2.  RE: Gel - email: add line break or carriage return

    Posted Aug 23, 2010 03:04 PM
    I have found that if you enter a line break in the code, it translates over to the GEL email. The same thing holds true with tabs.

    What I have done is loop or build the text I want earlier in the step and just include the variable in the GEL script.
    <gel:email 
    from="Clarity@noreply.com" 
    fromName="Clarity"
    subject="Application Created - '${V_NAME}' ${V_SUBJ}" 
    to="${V_EMAIL}">
    
    The following application has been added to Clarity.
    
    Application Name       : ${V_NAME}
    Application ID         : ${V_UNIQUE_NAME}
    Description            : ${V_DESCRIPTION}
    Application Status     : ${V_APPSTATUS}
    Application Type       : ${V_APPTYPE}
    Application Manager    : ${V_MANAGER}
    Application Supervisor : ${V_SUPERVISOR}
    Business Owner         : ${V_BUSOWNER}
    VP                     : ${V_VP}
    Director               : ${V_DIR}
    Enterprise Team        : ${V_ENTTEAM}
    
    http://${V_LINK}/niku/app?action=projmgr.applicationProperties&amp;id=${V_ID}&amp;investment_code=APPLICATION
    
    THIS IS AN AUTOMATED MESSAGE. Please do not reply to this email. 
    </gel:email>
    I hope this is what you were wanting if not let me know and I can try to help.


  • 3.  RE: Gel - email: add line break or carriage return

    Posted Oct 28, 2013 03:44 PM

    I'm having a similar issue.

    I'm generating a string variable (using &#xA; to add line breaks) that im including in a html message i'm parsing. The issue is that when I receive the email, the entire data in the string is appearing in one line. What other method could I use to apply these breaks?

    <!-- Build Variable List -->
    <core:if test="${resourceList == null}">
           <core:set value="${resourceLastName}" var="resourceList"/>
    </core:if>
    <core:if test="${resourceList != null}">
           <core:set escapeText="false" value="${resourceList}&#xA;${resourceLastName}" var="resourceList"/>
    </core:if>
     
    <!-- Generate Email Message -->
    <gel:parse var="htmlMessage">
     <message>
      <![CDATA[
       <html>
        <font face="calibri"> 
               <div style="font-size: 12pt;">
                       <p><b>Resource List:</b><br>
                       ${resourceList}</p>
               </div>
        </font>
       </html>
      ]]>
     </message>
    </gel:parse>
    <gel:forEach select="$htmlMessage/message/node()" var="thisMessageNode">
           <gel:set asString="true" select="$thisMessageNode" var="thisMessageNodeText" />
     <core:set value="${thisMessageNodeText}" var="thisMessageText" />
    </gel:forEach>

    <!-- Add email body text and format -->
    <core:new className="javax.mail.internet.MimeMultipart" var="multiPart" />
    <core:new className="javax.mail.internet.MimeBodyPart" var="bodyPart" />
    <core:set value="${bodyPart.setContent(thisMessageText, 'text/html')}" var="void" />
    <core:set value="${multiPart.addBodyPart(bodyPart)}" var="void" />



  • 4.  RE: Gel - email: add line break or carriage return

    Posted Oct 29, 2013 09:28 PM

    Use the escape attribute in the gel:email tag - this works for pre Clarity 13 versions

    For Clarity 13 onwards, use proper HTML format in the gel:email content. On upgrade from 12 to 13, you can use enclose the gel:email content with

    <![CDATA[<pre>..............

    ...............

    ...............

    </pre>]]>