Support Article
Parsing .EMT(Email) File to the RTE is getting unnecessary tags
SA-11873
Summary
Customer is using Exchange server 2010 SP2
Customer is attaching an e-mail to the work object and showing it in the RTE (Rich Text Editor). Before showing it in the RTE, they are parsing the email content which is attached to the work object. When parsing with HTML they are seeing unnecessary tags in the RTE
Error Messages
N/A
Steps to Reproduce
1. Create a work object
2. Save any Email to you desktop and attach to the work object
3. parse the email which is attached to the work object and made that content available to RTE
Root Cause
This issue is because of Microsoft using a proprietary format for its email(.eml) files. This is not a Pega issue and the problem domain is outside and not limited to Pega. Pega cannot provide a full EML to HTML converter as the EML format is owned by Microsoft and is not an open standard with published rules.
Resolution
In order to unblock the customer and provide a workaroubd for the particular usecase(single EML file), we are suggesting a local change which involves using regular expressions to filter out unwanted EML tags.
Local change provided only for the particular email attached. Note that the EML format is not completely understood by us and this local change may not resolve all issues.
Please add the following piece of code in a Java step of the email processing activity:
String emailContent = myStepPage.getProperty("pyNote").getStringValue();
/* Regular expressions to fix known EML quirks */
emailContent = emailContent.replaceAll("=[\\n\\r]+", "");
emailContent = emailContent.replaceAll("<o:p>", "");
emailContent = emailContent.replaceAll("<\\/o:p>", "");
emailContent = emailContent.replaceAll("=3D", "=");
emailContent = emailContent.replaceAll("=B7", ".");
myStepPage.getProperty("pyNote").setValue(emailContent);
Published July 8, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.