Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
8 subscribers
Views
2619 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have developed a process model to receive emails. I need to render the msg bod
jayanthik
over 9 years ago
I have developed a process model to receive emails. I need to render the msg body in a word document but I am seeing that the message properties "msgBody" is not preserving the spaces from the actual email message. The entire email message body is rendered as a continuous text when saved in process variable.
Do we have any appain rules/functions to format /render the message property "msgBody" which is of type text according to the message content type?
OriginalPostID-199780
OriginalPostID-199780
Discussion posts and replies are publicly visible
0
Jaggu
over 9 years ago
Hi Jayanti,
Try this approach
save msg!body into a variable, and do split and join you'll get the email body as it is.
local!eBody:trim(split(pv!emailBody,";<")[1]),
local!properEBody:joinArray(local!eBody,char(10) // or try joinArray(local!eBody,"<br/><br/>"),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jayanthik
over 9 years ago
it did not work. I tried splitting by char 10 & 13. Not sure why the msg body is shown in a single line once saved from msg properties.
Actual email message and expected results:
Hi Team,
Please complete the work.
Thanks
xyz
msg Body once stored in pv : Hi Team, Please complete the work. Thanks xyz
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
You can use the 'msg!properties'.'Bodies' and 'msg!properties'.'BodyTypes' message properties in the Receive Message event, when it is triggered using email messages.
These properties allow access to all of the bodies that may be in the email, regardless of content type. The properties are parallel arrays, so the index of the body in the first property is the same index as the corresponding body content type (such as, text/html) in the second property.
The default message body is that which has the content type text/plain and is accessible using the msg!body message property, that is why you lose the formatting.
If this is an HTML email you should be getting the second body, not the first one.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
That said, my suggestion is to store 'msg!properties'.'Bodies' instead and to read more about how to display that HTML at
forum.appian.com/.../Receive_Message_Event.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel