Is that possible to trigger the mail merge template for E-sign using Custom Function as per the order wise ?

Is that possible to trigger the mail merge template for E-sign using Custom Function as per the order wise ?

Dear Team,

Please refer to the below query.

 - While sending the mail merge template for E-Sign. I need to send it as per the order wise for multiple signature. 

For Example,

1. CEO -
First Signature [Signer]
2. Customer - Second Signature [Signer]
3. PRO -
Third Signature [Approver]

Using Custom Function, Can we achieve this ?

Or else,

Is there any other way to achieve this functionality ?

Please let me know the better solution for this. 

Thank You.