x
login Signup

How can I display a multi-line property in a ElectricCommander email notifier?

I am trying to print a multi-line workflow property in an email notifier, however it is being displayed in a single line rather than multiple lines.

My property looks like something this:

 rpm1
 rpm2
 rpm3
 rpm4

It is being displayed like this in the email:

 rpm1 rpm2 rpm3 rpm4

Snippet from email body template:

 <H3>Installed Software</H3>
 $[/myWorkflow/installedRpmList]
avatar image By mike arruda 132 asked Oct 16, 2014 at 09:50 AM
more ▼
(comments are locked)
10|750 characters needed characters left

2 answers: sort voted first

This is a feature of HTML -- unless you tell it otherwise, it assumes that line breaks are just like any other white space.

Option a) Use javascript to translate the newline characters to the HTML tag <br/> -- which is an HTML line break.

Option b) Use the <pre> tag to tell it that the text is "preformatted", which in addition to some other stuff will preserve your newlines. That would look like:

<H3>Installed Software</H3>
<pre>$[/myWorkflow/installedRPMList]</pre>

avatar image By mike westerhof 2.8k answered Oct 16, 2014 at 10:10 AM
more ▼
(comments are locked)
avatar image mike arruda Oct 16, 2014 at 02:03 PM

Brilliant! This worked. Thanks so much!

10|750 characters needed characters left

I believe the answer lies in how text is rendered in HTML. Carriage returns are largely ignored unless you use something like to indicate formatted text. In your example above, you would instead write:

 <H3>Installed Software</H3>
 <pre>
 $[/myWorkflow/installedRpmList]
 </pre>

I haven't rendered the HTML myself, but I believe that should work.

avatar image By marcoman 2.2k answered Oct 16, 2014 at 10:12 AM
more ▼
(comments are locked)
avatar image mike arruda Oct 16, 2014 at 02:03 PM

Thank you!

10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.