We have a request to automatically generate a docusign gen template that contains merge fields from an opportunity then automatically send it.

Docusign have confirmed this is not possible using the docusign apex tool kit. However I found this video on YouTube https://youtu.be/cjOFo_j1PS0?si=FG-Sz0Qna9dUbfq5

Which uses the genAndConvertEnvelope endpoint and provides a code example in the link but I’m new to Apex and stuck as to how to use the genAndSendEnvelope end point to go one step further and send the generated document via the api.

Does anyone have any apex code examples they could share or any advice on how to do it please?

I would like to do it with combination of flow and invocable apex where flow passes recordId, docusign templateId (with merge fields), recipient name and email as invocable variables to the apex class then use an at future method to make the callout to generate the document, create envelope, add generated document to envelope, set recipients and then send to recipient.

Has anyone done something similar?




Browse other questions tagged .