function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Thaier IssaThaier Issa 

How to send an email template from a custom button via apex on a locked record?

I have a custom object that goes through an approval process, when this approval process is initiated the record locks, I made an email template and I am trying to figure out how to send the email when the user clicks a "Request Unlock" button, I've tried using multiple things but none of it works because the record is locked so users can't do anything with the button. How can I do this via an apex trigger? Any help would be appreciated. 
Thaier IssaThaier Issa
Addition: The record is supposed to be locked, we'd like to keep it that way. The issue we are having is when the approval process completes the record stays locked so the user has to notify us so we can manually unlock it, we'd like to expedite the notification process by making it a simple button click.