Replay to email received from the activity log in the classic UI by pressing replay all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 02:08 AM
HI,
I saw in instance (that I don't have access to) that there is an option to add to the activity log the ability to replay/replay all/forward to an email that was received by pressing a button.
Can any one help me with this requirement?
I do know that the ability to replay to an email is in the workspace but my customer wants to work in the classic ui and he wants the ability to replay to an email from the activity log it self.
Hope I was clear.
Thanks to any one that answer,
Lior Grinberg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 09:02 PM
It is possible to add custom buttons to the activity log in ServiceNow Classic UI using UI Actions. UI Actions are scripts that run on the client-side or server-side and can be used to perform custom actions, like opening a form, updating a record, or sending an email.
To add a custom button to the activity log, follow these steps:
- Navigate to the activity log list view in ServiceNow Classic UI.
- Click the "Form Layout" button in the top right corner of the screen.
- Click the "UI Actions" tab.
- Click the "New" button to create a new UI Action record.
- Enter a name for the UI Action, like "Reply to Email".
- Select "List Context Menu" as the "Client" value, and "All" for "Applies to" to ensure that the UI Action is visible for all users.
- In the "Action" field, select "Run Script".
- In the "Script" field, add JavaScript code that sends an email in response to the selected email in the activity log.
Here is some sample code that sends an email in response to the selected email in the activity log:
(function() {
var gr = g_list.getChecked();
if (gr && gr.length > 0) {
// Get the first selected record in the activity log
var selected = gr[0];
// Get the email address of the sender
var sender = selected.getValue("email");
// Create a new email record
var email = new GlideRecord("sys_email");
email.initialize();
email.type = "send-ready";
email.recipients = sender;
email.subject = "RE: " + selected.getValue("subject");
email.body = "Type your reply message here.";
// Save the email record
email.insert();
// Show a confirmation message
gs.addInfoMessage("Reply sent to " + sender);
}
})();
This code gets the first selected record in the activity log, gets the email address of the sender, creates a new email record with a "RE:" prefix in the subject line, and sends it to the sender.
You can modify this code to include additional functionality like forwarding the email or sending the email to multiple recipients. Once you have created the UI Action, it will appear as a custom button in the activity log for all users.
Please mark my answer as a solution/helpful in case it adds value and moves you a step closer to your desired ServiceNow solution goal.
Thanks,
Punit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 02:55 AM
I found the solution:
I add the system property: glide.ui16.emailStreamResponseActions
Type: true/false
Value: true
Made sure that in the property: glide.ui.activity.email_roles all the rellvant roles are there including admin
and then I got this in the activity log: