Emails visible in activity log

it_ninja13
Kilo Contributor

Hello everyone,

 

I m pretty new in this scripting world so take it easy 🙂 
I need to find a way to log emails (internal and external) that are being sent from/to ServiceNow in the request activity log. 
I found some posts from like 3-4 years ago but I couldn't make it work

thank you 

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

Not 100% sure what you mean as they are already logged in the activity log...

Perhaps you don't have them set to show?

But if you go here in a record for example:

find_real_file.png

You'd pick the field(s) you want to show in the log. If it doesn't appear initially, then click that "Configure available fields" and slide the "Sent/Received Emails" selection to the right column and save.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

9 REPLIES 9

Hello,

Then those emails that are being sent for reminder approval aren't associated to this specific record. Reminders aren't OOB, so...you'd need to show what your script is in regard to sending those reminder emails. If the email is associated to this specific record, then it will show in the activity log if you have "Sent/Received Emails" as a visible option.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

This is our script : 

 

remindApprovers();
function remindApprovers(){
// remind everyone, all the time?
var spamMachine = false;

var appr = new GlideRecord('sysapproval_approver');
if (spamMachine){
appr.addQuery('state', 'requested');
}
else {
appr.addEncodedQuery('state=requested^sys_updated_onRELATIVELT@hour@ago@24');
}
appr.query();
while (appr.next()){
gs.eventQueue("approval.inserted", appr, gs.getUserID(), gs.getUserName());
gs.log('Re-requested approval of task ' + appr.sysapproval.number + " by " + appr.approver.name);
}
}

Also we also need to log in emails that are being sent on demand from a custom template, not OOB 
We added a step to send email manually from the workflow and we need to log that also 

I see.

So the difference, initially, that I see is that you're using the same approval event to send the notification again, curious if that's not tracking things appropriately. We too do reminder notifications, but I've developed the solution to fire a new event, that triggers a different/custom notification. On the sysapproval_approver table, for example, that has verbiage about it being a reminder, etc.

If you develop this same solution for the onDemand feature, they should post appropriately.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

it_ninja13
Kilo Contributor

hello everyone

thank you for yout help