Automate the echosign functionality via apex or java code
This related to the Echosign plugin for salesforce, where you can specify an account/contact ( the Signer) and a document to be signed and click to "Send for Signature" button and echosign sends an email to the signer and so on...
Now we're trying to automate this part and write some java/apex code that fetches a document and a customer from salesforce, shows it on our company website and on click of a button on our website we would like to send the "agreement notification" email as sent by Echosign widget.
Or in other word we're looking to press the "Send for Signature" button progamatically.
We're able to fetch the documents and customers from SalesForce, but not able to generate the "agreement notification" email containing a link to the doc. to be signed, which is sent by Echosign.
Please give us an idea how to do this ?
Echosign Agreement Automation issue
We are currently a user of Echosign for Salesforce and we are in the process of automating the creation of echosign details with a click of a button.
What we would like is to create the Echosign's agreement record, fill up all the necessary fields, create the agreement record and then attach the document and possibly send the document to the recepient all in one go via Force.com Sites.
Everything is currently working quite well like the agreement record gets created and the attachment automatically attached but the problem is that when I try to click the "Send to Echosign", it doesn't send anything to me although the status says that it was already sent.
I tried creating one manually using the exact information inside Salesforce via the Agreemnt tab and it was able to send me the email notification that I have an agreement to sign.
Any ideas if there are any difference between creating a record manually vs. creating it via code? It seems like the Agreement tab only uses the standard Salesforce pages.
You could refer to my code below:
echosign_dev1__SIGN_Agreement__c agmt = new echosign_dev1__SIGN_Agreement__c(); agmt.Name = 'Sample Agreement'; agmt.Social_Ads_Campaign__c = currentSACId; // Custom lookup field agmt.echosign_dev1__Recipient__c = getselectedSAC().Delivery_Partner_Contact__c;// Contact field agmt.echosign_dev1__RemindRecipient__c = 'Every Day, Until Signed'; agmt.echosign_dev1__SenderSigns__c = true; agmt.echosign_dev1__Message__c = 'Please sign the attached Insertion Order'; agmt.echosign_dev1__SignatureType__c = 'e-Signature'; agmt.echosign_dev1__PasswordProtectSign__c = false; agmt.echosign_dev1__SenderSigns__c = true; agmt.echosign_dev1__PasswordProtectPDF__c = false; agmt.echosign_dev1__SignatureOrder__c = 'I sign, then the Recipient signs'; agmt.echosign_dev1__Status__c = 'Draft'; insert agmt; PageReference pdfPage = Page.SocialAdCampaignIOPDF; pdfPage.getParameters().put('id', currentSACId); Blob pdfBlob = Blob.valueOf('Sample PDF'); pdfBlob = pdfPage.getContentAsPDF(); String filename = agmt.Name + ' ' + DateTime.Now().format('MM-dd-yy') + '.pdf'; Attachment a = new Attachment(parentId = agmt.id, name=filename, body = pdfBlob, ContentType = 'application/pdf'); insert a;