Text Variable (multi-line) not displayed properly in Email body.
Good day,
I tried to include a text variable (multi-line data)in my email body. The email is being sent successfully but the text message from the variable does not display correctly.
For example:
Using textarea widget, I save the text below to a Text data variable
*Good Day,
I regret to inform you that...
Thank you*
When this is sent via email, it is displayed as Good Day, I regret to inform you that...Thank you. But when I view the data using another textarea it is displayed properly.
Thank you in advance for any help on this.
Regards, Alfred Ayson, PMP
Thank you Sean McP for the insight on how to do this.
I realized that I was using the wrong widget in the first place. Instead of using the textarea widget, I should have used the "Rich Text Area" widget.
Thank you again.
Comments
Glad to be of help...
regards
Seán
Hello, I am working on creating word and pdf document.
I put the contents from the rich text widget.
by email, the text looks normal without HTML tag, however, inside word document the HTML tag still exists.
This url is what I asked already.
https://community.bonitasoft.com/questions-and-answers/how-retrieve-html...
Would you give me any guide for this issue?
I would appreciate any help.
Thanks in advance.
Comments
Hi.
I have the same problem for my email connector. To "solve" this, I use a Java script to add "\n" at the end of each line.
Yannick has one answer.
In my case I use HTML, check the HTML box and use a groovy script connector to build the text...
String nl = "</br>";
String italicS = "<i>";
String italicE = "</i>";
emailText.append("My text"+);
emailText.append(italicS+"My italic Text"+italicE);
return emailText.toString();
Of course you could also use inline CSS using this method and get really fancy with your emails.
I do this as I use tables a lot.
regards Seán
In my case, I have message for the email is entered using a textarea widget. I save this into a string variable. The string variable is what I use in the email connector as "Message". But the email does not disply multi-line values correctly. It is displayed as single line.
I see what you're trying to do, and my "answer"/test results are below:
Apologies if this is rather simple, I like to "talk" through a problem...
Step 1 is a Human Task Open a page with a Rich Text Field on it enter text with multiple lines using the enter key as required...
Step 2 is a Service Task with an email connector In the message you are placing the message typed in step 1 The message gets sent...
And you are seeing a single line in the received email rather than the proper message with new lines in it.
This is what I did
Pool variable - t1 Text
Step 1 is a Human Task Application page with a Rich text field on it Output operation is t1 Takes value of field_Rich_TextArea1
Step 2 is a Human Task - this is a sanity step for data validation - not necessary but used purely as a debugging mechanism On it we have a Rich text field pointing to t1; AND a text field also pointing to t1
Step 3 is a Service Task with an email connector the message text is set to variable t1
When running I add text in Step 1,
in Step 2 the Rich text field shows the same formatting as typed in in Step1, and the text field shows me the following (in this example)
This shows me the field has the newlines in it, and any other formatting applied, this step should be removed in normal use
and Step three sends the email.
The email is received correctly with all the formatting in it including the new lines...
It works for me...so I don't know what's happening in your case. It works here.
Here is a dropbox link to the BOS I have working...Hope it helps
6.4.2 by the way!
regards
Seán
https://www.dropbox.com/s/13rwdfnjgdgibvk/TextBox-1.0.bos?dl=0