How to use script output in Send Email action in Flow Designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 11:25 AM
I've been trying to accomplish this for a while now. What I want to do is perform some actions in a script and output a variable with several lines of information. I then want to insert this output variable in the body of an email (Send Email action).
The problem I am seeing is the error message "Email validation failed: Email body is comprised of invalid HTML." when the flow executes.
The script is storing string in a variable with line breaks, when I use "\n" I see no error but the email body does not translate those line breaks and everything runs together. When I use <br> or wrap in <p> I see the validation error.
I've tried different output variable types like string, HTML, HTML Template, Translated HTML, etc.. Nothing seems to work.
Thanks for any help you can offer.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2020 08:49 PM
Hi Wes,
Without seeing the flow execution and error when trying to put the string into the email action it's hard to say what is causing it to error for your first case.
Another option is always Fire an event from Flow Designer (create a record in the Sysevent table), include the extra information you want in the email in the "Parm1 or Parm2" fields, and trigger the notification from the event.
You may even be able to fire the notification from the script action and skip doing it after that in the flow all together?
Hope that helps,
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2020 06:13 AM
Here is the flow:
The goal is that when a user is deactivated, all accounts for that user are deactivated across all instances.
The output of the script in the body of the email should be formatted like this:
But the formatting required to get it this way always fails. When I use /n as the line break the validation passes and the email sends but it looks like this:
.... I've attached the images as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 05:50 AM
So I was not able to solve the issue of using line breaks in script output within flow designer. However, I was able to accomplish the desired end result by running the actions in an email script and referencing the script in an email notification. This may work in the email action in flow designer, but in the end I just stuck with a simple notification + email script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2021 09:26 AM
hii, wes, can you give your solution here