- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2020 02:44 AM
Hi,
When I use outlook actionable messages for surveys, the embedded survey will "override" other information in that notification.
For instance, I would like information on an incident or Case to be included in the notification with the embedded survey. Is there a way to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2020 02:28 PM
Hi,
This is such a hit and miss plug-in for me, there is so much great work in there but the ability to customize is such a big piece of the puzzle. It is a notification after all.
Digging into the plugin I can see most the magic of creating the embedded survey is done in the protected script include, SurveyAdaptiveCardGenerator.
The first issue is the hideOriginalBody is set to true (see below), which works great for a clean embedded survey but takes any chance away of customizing around it. I think this is the override piece you are talking about.
this.card = {
"type": "AdaptiveCard",
"version": "1.0",
"originator": gs.getProperty('sn_ms_oam.outlookactionable.originator'),
"padding": "none",
"expectedActors": this._getExpectedActors(),
"hideOriginalBody": true,
"body": []
};
Description of hideOriginalBody copied from Microsoft Doco
When set to true, causes the HTML body of the message to be hidden. This is very useful in scenarios where the card is a better or more useful representation of the content than the HTML body itself, which is especially true when the card contains actions. Consider hiding the original HTML body if the card itself contains all the information a user would need, or if the content of the card is redundant with the content of the body. Do always include a nice, meaningful HTML body, even if it is going to be hidden. The HTML body is the only thing an email client that doesn't support cards will be able to display. Furthermore, cards are not included when replying to or forwarding emails, only the HTML body. Don't hide the body when it is complementary to the information presented in the card. For example, the body of an expense report approval might describe the report in great details while the card just presents a quick summary along with approve/decline actions.
For me I would really like to add some branding as it helps with uptake of the notification as we use specific logos to make this look like a company email. (fully aware that's what phishing is :))
IF we could modify the script include, I think that is where you would be able to add the additional information you wanted.
Really I would like to see some configuration options added to this plugin, like some simple branding or more input into how the protected script include behaves would be great.
If anyone has some workaround ideas on how to brand "outside the box" that would be great. My only thought now is to possibly manipulating the notification before it is sent to add the required AdaptiveCard JSON, for my use case that would be:
{
"type": "Image",
"url": "https://path_to_image_here",
"altText": "
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 09:37 AM
Hello - I've been trying to customize the embedded survey also to include the following:
Incident information:
Number: ${trigger_id.number}
Short description: ${trigger_id.short_description}
Opened Date: ${trigger_id.opened_at}
Resolved Date: ${trigger_id.resolved_at}
Resolved By: ${trigger_id.resolved_by}
Resolution: ${trigger_id.close_notes}
I have found if I go View Surveys, and Click on the survey. Then add the information above to the Introduction:
Then, The invite puts the results on the header of the email which is great, but the text is all run together. I'd prefer it was formatted better with Spaces, line breaks, etc.
I've added <br> and /n to the text, but it made no difference.
Any ideas how to do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2023 08:29 AM
where you able to work out a solution @richsnipe

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2023 08:36 AM
No, I haven't, and moved on to other things. If you figure it out, it would be great if you share.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2024 08:59 AM
Hi richsnipe, I tried the similar way that you did to show details in the introduction section, it didn't work for me.
Am I missing anything?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2021 04:35 AM
Hi Victor,
I've had the same issue and instead of customising the entire set of scripts provided by ServiceNow, which will also cause problems in the future with upgrades, I decided to tackle it at email object level.
Thanks to the information provided by Tim I've found a way to intercept the sys_email generated that contains the embedded survey, using a business rule, so that before it gets sent out I replace the property value of hideOriginalBody from true to false.
The onBefore insert business rule is very simple:
var body = current.body;
var showOriginalBody = body.replace('"hideOriginalBody":true', '"hideOriginalBody":false');
current.setValue("body",showOriginalBody);
In order to execute the business rule only on emails with the embedded survey, I added a condition which says:
if body contains "hideOriginalBody":false
I've tested and it works perfectly. I guess this could also help to Tim's issue where he wants to add extra content to the payload. It can be done on the fly without customising the Snow scripts.
Only issue I have is that the Survey is always placed at the top of the email. It ignores the position I place to. But overall it's not a big deal, as long as it shows me both the Survey and the content of the email.
Here an example: