how to change APPROVAL email body

ggg
Giga Guru

I am using workflow to generate approvals.

and the oob email notification is sent (Approval Request)

I need to customize this oob approval email notification for my custom table (contain custom table fields and verbiage ...)

Does someone know how to do this?

1 ACCEPTED SOLUTION

ggg
Giga Guru

i found this link

https://community.servicenow.com/community?id=community_question&sys_id=804155b2db1163c011762183ca96199c

this helped me resolve my approval email task.

View solution in original post

6 REPLIES 6

Weston Wilson
Tera Expert

You can configure the approval email by setting up a duplicate notification or adding in a conditional email script to the out of box notification. If you duplicate the email, filter the table you want (i.e. document_id/approval_for = custom_table) and add in fields from that table using ${table.field} format or using an email script. 

for example:

notifications has Approval Request

which uses email template change.itil.approve.role

which uses mail script change_request_summary

I do not want to change any OOB behavior

so

I am unclear on which of these objects to change to get data from my custom table

and

HOW to get data from my custom table (the current object would be sysapproval_approver (I think)

how do i get from there to my custom table? )

 

 

In order to get data from your custom table, you use the format ${approval_for.custom_field} or ${document_id.custom_field}. It is just dot-walking into the field from the sysapproval_approver table. The approval_for and document_id fields are the reference to the record on the custom table for which the approval has been created. 

To have the least effect on the out of box behavior, you will need to set up a filter on the out of box email notification. Something like "task type is not custom_table". Then you can perform an insert and stay on the email notification to duplicate it and set the filter to "task type is custom_table". 

find_real_file.png

 

If your table does not extend task, you should be able to set up other notifications without modifying the existing ones. 

I got the notification condition task type:

on the oob approval email notification i use task type not 'mycusttable'.

i create a new notification,

table is mycusttable

event is approval.inserted

and it uses my new email template.

the approval records are created correctly,

BUT

the email is NOT sent.

am i doing something wrong?