Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi all,
We have some notification triggers that send our users a mail about specific situations. These triggers then read certain fields of the triggering item in order to use these contents in the text of the mail for a quick overview. Some of these fields are rich text fields, which are basically composed of MKS-HTML code. But now this code can't be understood by Outlook or other mail programs, so that the MKS-HTML tags can be seen in the text of the mail, which makes the whole thing very difficult to read.
Has anyone found a way to filter out this MKS HTML code or convert it to normal HTML without parsing all the text in the mail trigger script? Thank you....
kind regards, Jens
Solved! Go to Solution.
Hello Jens,
you could use JavaScript and/or Java to filter XML Tags away (via RegEx).
You may also retrieve the text only via build in API call and appropriate option.
Would suggest to start with ReqEx first.
Does this help?
Volker
Hello Jens,
you could use JavaScript and/or Java to filter XML Tags away (via RegEx).
You may also retrieve the text only via build in API call and appropriate option.
Would suggest to start with ReqEx first.
Does this help?
Volker
Hi Volker,
yes, this could work, but my first intention was to find a way without parsing the whole text. Not very realistic, but you never knows...:)
kind regards, Jens
Hi Volker,
tried it with RegEx and it seems to went well. At the moment I am sending the complete text of the mail through this function, and so far the complete HTML code is replaced by line breaks and spaces. Maybe there are some special tags that I don't handle at the moment, but for us it's enough. Mabe it helps someone else too...
function killTags(string) { var re1 = new RegExp('<br[^>]*>','g'); var re2 = new RegExp('<p[^>]*>', 'g'); var re3 = new RegExp('<[^>]*>', 'g'); return ('' + string).replace(re1,'\n').replace(re2,'\n').replace(re3,''); }
kind regards, Jens