I have a text box in which I concatenate several text boxes. I have line breaks indicated with Environment.NewLine. This then gets added as a new record to UD15. The line breaks are still in place. However, a BPM then used the entry in UD15 to send an email. The email text does not keep the Line Breaks. What do I need to do with my text in UD15 to keep the line breaks in the email body?
What I am doing in one of my custo is having a tag before each newline ([#line#]) for formating. Then, in the BPM, before the e-mail widget is used, I have a code widget that transforms all into a nice HTML format reading (and removing) the tags and copy all that into a callcontext character field. Which is then used in the body of the email widget.
I create emails all the time, I’m usually using custom code. But I code my breaks with a \n in the string, such as: vBody = “This is line 1.\nThis is line 2.”; It sounds like your use of Environment.NewLine is equivalent.
It looks to me like you’re doing everything right. Going out on a limb, is there any chance your email is “leaving” Epicor correctly, but something else is removing the lines? Something on your email server or your email client?
A few other things you may want to try, just to troubleshoot:
Try \n instead of the Environment.NewLine field.
Try doubling up the new line: \n\n
Try a few of the other options: \r or \r\n
Rather than emailing your constructed text field, test an email where you are concatenating the fields with the new line within the email, not passing a field that already has it.
Look at your data that you’re saving (in hex format, for example). Perhaps it’s doing something with the new line as it’s storing the field.
Wow!! … Including the HTML framing (probably the wrong word) in the body of an email widget makes it HTML!!
How come I am just learning this now!!!
The “framing” required is
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
(This is an automated message. Please do not reply)
</body>
</html>
and you can define styles in the <head> section too!!!
You might (emphasis on “might”) be able to intercept message body, with a BPM, and convert it to HTML. But doing that is just as hard (if not harder) as coding it in a BPM to begin with.
and it did come through. Here’s the email I received from a BPM that uses the email widget. Not the word “Please” is underlined and bolded (even though this font isn’t so great for making bold).
Maybe I just got lucky and Outlook decided to render that “embedded” HTML.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
(This is an automated message. Please do not reply)
</body>
</html>
only works in the email widgets of a BPM.
It does NOT work in the email widget of a Break/Routing… You get: