- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2024 04:03 PM
How is this possible?
If the data input is having any HTML tags, the source field type should be HTML instead of string. If that is not possible, then there should be some intermediate step to encode it before passing to SendEmail action.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1124509
Can someone please explain in detail how this can be accomplished?
We are getting this error on a 'Send Email' action in a FD flow:
Email validation failed: Email body is comprised of invalid HTML.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 10:30 AM
Clean HTML- Flow Designer Action
Create a FD Action with Input:
Script Step:
Script:
(function execute(inputs, outputs) {
// Input variable
var htmlString = inputs.htmlString;
// Remove HTML tags using regular expressions
var cleanString = htmlString.replace(/<br ?\/?>|<\/p>/ig, "\n");
cleanString = cleanString.replace(/<script[^>]+>.*<\/script>/ig);
cleanString = cleanString.replace(/<style[^>]+>.*<\/style>/ig);
cleanString = cleanString.replace(/<[^>]+>/g, "");
// Output variable
outputs.text_out = cleanString;
})(inputs, outputs);
Create Action Output:
Call the FD Action from the FD Flow:
(this will get the latest email response)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2024 05:40 AM
Any help on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 10:30 AM
Clean HTML- Flow Designer Action
Create a FD Action with Input:
Script Step:
Script:
(function execute(inputs, outputs) {
// Input variable
var htmlString = inputs.htmlString;
// Remove HTML tags using regular expressions
var cleanString = htmlString.replace(/<br ?\/?>|<\/p>/ig, "\n");
cleanString = cleanString.replace(/<script[^>]+>.*<\/script>/ig);
cleanString = cleanString.replace(/<style[^>]+>.*<\/style>/ig);
cleanString = cleanString.replace(/<[^>]+>/g, "");
// Output variable
outputs.text_out = cleanString;
})(inputs, outputs);
Create Action Output:
Call the FD Action from the FD Flow:
(this will get the latest email response)