Topic
  • 3 replies
  • Latest Post - ‏2009-04-28T14:20:44Z by SystemAdmin
SystemAdmin
SystemAdmin
100 Posts

Pinned topic Email with extra line breaks through send mail

‏2009-04-27T19:12:44Z |
All,
   We have created a send mail activity within Cast Iron that will take text we send to the body to inform users we have a new client.  Our email system adds a legal disclaimer to the bottom of the email, and our body is merging in with the disclaimer.  Is there a good way to add line breaks in our text so there is separation in the email?  We are sending a concatenated string to the text part of the body.  We are using a mix of strings and variables to build this.  I have tried "/n" in this, but all it does is add "/n" to the end of the text.  Any help would be appreciated
Updated on 2009-04-28T14:20:44Z at 2009-04-28T14:20:44Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    100 Posts

    Javascript to return a line break

    ‏2009-04-27T21:18:02Z  

    /n will be treated as text only in the built-in concatenate function.  Instead, use a javascript: See our FAQ at http://www.customware.net/repository/pages/viewpage.action?pageId=11239548

  • SystemAdmin
    SystemAdmin
    100 Posts

    RE: Adding extra line breaks to the email body

    ‏2009-04-28T13:41:02Z  

    Go to the Functions tab.  Right-click the Custom Functions and select "Add new Custom Function".  Type in the function name AddNewLineNoInput (or whatever you choose).  There is no input and it should return a String element then click Next.  Paste this into the dialog window:



    return ('\n\r');



    Click Compile, Click Finish.  You can drag this function to your email activity and map it to the body as many times as you want.  It will insert a blank line in the body.  You can even make variations of this function like "Add5BlankLines" using



    var outStr = ('\n\r')+('\n\r')+('\n\r')+('\n\r')+('\n\r');

    return outStr;



    Hope this helps.

    Steve





    Steven M. Longo





























  • SystemAdmin
    SystemAdmin
    100 Posts

    Another way to add line breaks

    ‏2009-04-28T14:20:44Z  
    You could also add an input parameter to enter how many line breaks you want. Like this:

    var i = 1
    var outStr = ''


    while (i<=inputNum)<br />
    {
       outStr = outStr + ('\n\r');
       i++;
    }


    return outStr;

    (No error checking on input in this example)