How to add approve and reject action link in email template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 07:19 AM
Hi everyone,
I want to add/show associated approval "Approve" and "Reject" action on email template in the notification.
How we can implement can anyone tell me from start to end steps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 08:11 AM
Hi @rmaroti,
This is quite a common question and request. So as to not reinvent the wheel, check the following link which provides a couple of responses from current MVP's with a nice walk through via video as well as a 'nicer' customer UX option.
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 08:22 AM - edited 04-10-2025 08:27 AM
Hello @rmaroti ,
I assume that this is about some process that does not trigger the regular Approval [sysapproval_approver] records, since those would already trigger the kind of email notification you are looking for.
The general steps to configure this are:
1. Go to System Notification > Email > Templates and create a template, like this:
Name: choose a name, e.g. "approval.action"
Subject: Re:${number} - approve
Message: Click here to approve ${number}
Then create another template, but for rejection. I assume the record that is to be approved has a field called Number; if not then change to something else that is unique.
2. Put this somewhere in your Notification's "Message HTML" field:
${mailto:approval.action}
${mailto:rejection.action}
This will make the email contain the links for approving/rejecting, just like the OOTB approval notifications.
But you also need to make sure that the approver's email response is processed, so a last step is required:
3. Go to System Policy > Email > Inbound Action and create a new Inbound Email Action:
Name: choose a name
Target table: choose the table that the notification is about
Action type: Record Action
When to run > Type: Reply
Actions > Script: this depends entirely on what shall happen when an approval or a rejection for that particular table/application is received, so the following code is just an example and needs to be adjusted as per your requirements
if (email.subject.indexOf("approve") >= 0) {
current.state = "approved";
}
if (email.subject.indexOf("reject") >= 0) {
current.state = "rejected";
}
current.comments = "reply from: " + email.from + "\n\n" + email.body_text;
current.update();
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 08:33 AM
