- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 04:14 AM
Email notifications sent for additional comments updates to users have [code] tags. This happens only when comments are added to the incident from service portal, comments added from native UI works fine. Could I get some help here please
Email template Script:
(function runMailScript(current, template, email, email_action, event) {
template.print(current.comments.getJournalEntry(1));
})(current, template, email, email_action, event);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 02:14 AM
Ok, so the portal comment field probably adds the code tag automatically so that it can show correctly any formatting on the messages.
You could either modify the notification to use a email script and remove the code tags or create a before insert BR that checks the body for [code] and [/code] and replaces those with "" for example. Something like:
current.body = current.body.replace("[code]", "").replace("[/code]", "");
Give that a try and see if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 04:27 AM
Perhaps your portal widget has customization in it that always ads [code][/code] around the comment to allow some tags to be used in portal comments? I'd check that first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 07:18 AM
I'm not sure about that, we are using 'Standard Ticket' configurations and the comments are added into 'Activity' tab. I do not see anything specific in there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 12:27 AM
Well, the comments are written in a HTML editor, so that definitely could add the [code] tags automatically. Do you have the html editor also on the native UI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 01:02 AM
@Weird No, it's the 'additional comments' journal field in the native UI.