- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 01:22 AM
Hi,
we have a catalog item which pick up a set of emails (Variable is string field) example sample,sample <sample.servicenow.com> the tag once used if i am sending an email via the Flow designer the email puts and error as Error: Email validation failed error: "Email body is comprised of invalid HTML" Once i remove the tag manually and give it as sample.service-now.com it starts working, Is there any way we can stop this error from happening.
Can we replace the < tags> with blank spaces i am not sure would be helpful if some one could help with this i am moving towards a before business rule but not getting ideas on where to start from.
Regards,
Saurabh Singh
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 07:45 AM
You can create an "action" with an input string, a step to remove HTML tags and an output string.
In "my case" I only need to remove "<>" characters. My issue is with a string containing <a@a.com> or <sip:xxxxx>
This is the step into the action
(function execute(inputs, outputs) {
// Input variable
var htmlString = inputs.text_IN;
// Remove HTML tags using regular expressions
var cleanString = htmlString.replace(/[<>]/g, '');
// Output variable
outputs.text_out = cleanString;
})(inputs, outputs);
Please mark helpful or correct if I helped you.
This action will help other members with similar issues to find a solution.
Thanks
Ariel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2023 12:18 PM
Realizing this is an old post, but for anyone looking for a solution and finding this as I did - we ended up changing our variable type to HTML instead of multi-line string. When using the HTML variable type, SN seemed to know what to do in composing the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 12:33 AM
We're also getting this. As we paste some emails (including the header) into Work Notes, we have a flow that adds the latest work note to a "Send Email" and this always Errors with the above error.
I've seen solutions whereby we need to add Regex to strip the bad HTML from the email body, but I'm unsure of where to add this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 07:36 PM
I am looking for a solution too. i see that using regex to strip HTML tag may help.. but i don't know where to put it...If anyone have a solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 07:45 AM
You can create an "action" with an input string, a step to remove HTML tags and an output string.
In "my case" I only need to remove "<>" characters. My issue is with a string containing <a@a.com> or <sip:xxxxx>
This is the step into the action
(function execute(inputs, outputs) {
// Input variable
var htmlString = inputs.text_IN;
// Remove HTML tags using regular expressions
var cleanString = htmlString.replace(/[<>]/g, '');
// Output variable
outputs.text_out = cleanString;
})(inputs, outputs);
Please mark helpful or correct if I helped you.
This action will help other members with similar issues to find a solution.
Thanks
Ariel