Skip to main content

I have Docusign integrated with Salesforce. Currently, I have a DocuGen Template created and I can click a Salesforce button to generate a document from an Opportunity, complete with various merge fields. 

I have a use case where I’d like to help automate workflows by having a Salesforce Flow (with Invocable Apex assistance, if necessary) take a given Opportunity, generate the ContentDocument, and then attach the ContentVersion as an email along with a Salesforce Email template and send it to a Contact. 

I can see how to generate a Docusign Envelope through Apex (really great documentation btw), but I don’t want an entire envelope. I just want to generate the doc itself, and send that raw doc attached to a templated email to the designated Contact for review. I cannot find any documentation about how to use the DocuGen features to use the Template and merge fields to generate the doc so that I can use it as an attachment. Any help is appreciated. 

Thanks!

Watch this guys’ videos,  he’s not using the apex toolkit,  but,  he is generating a document via the API and saving it to a record.  Once you’ve done that,  you can send it via Salesforce in the usual way.

How to connect using Named Credentials,  super useful and great from a security standpoint

The good stuff,  connecting to the api,  building the JSON to generate the document

He has a git repo with the code used in this demo, https://github.com/scooke-work/generate_and_convert


Reply