I want to send e-sign agreement either with an Apex trigger or via Process Builder. I have configured "Send on behalf of" field to a salesforce user. I have created a record in echosign_dev1__SIGN_Agreement__c object, have populated recipient and linked to master opportunity as well as follow
for(Opportunity opp: opps)
if(opp.Offer_Stage_Status__c=='Offer Accepted' && opp.Applicant_1__r.PersonEmail!=null)
echosign_dev1__SIGN_Agreement__c ag=new echosign_dev1__SIGN_Agreement__c();
ag.Name=opp.Name + System.now();
The above code inserts the agreements. There is more code after the above segment which attaches a PDF file to the record inserted above.
Now I want to trigger the send action. Any idea how should I trigger the document sending?
Ideally I'd like API function to send the document.