For instance, if you send an email to the system, your email client will most likely include HTML and CSS.
This is how the Message attribute looks like: This is how the Message attribute looks like after using some regular expressions:
Code: Select all
/*
1. Strip HTML tags.
2. Remove weird CSS created by the email client.
3. remove space if it appears at least 3 times in a row.
4. remove newline if it appears at least 3 times in a row.
5. Remove character that messes upp saving the form.
*/
REPLACE_PATTERN(REPLACE_PATTERN(REPLACE_PATTERN(REPLACE_PATTERN(REPLACE_PATTERN(InkommandeMail.Message,'\<[^\>]+\>',''),'.*;}',''),'\s{3}',''),'\n{3}',''),' ','')
Is there a smarter way to "wash" the Message field, or preferably, get the plain text version so it doesn't require processing?