For sending emails to embedded recipients, specify clientUserId and embeddedRecipientStartURL when creating the Recipient.
embeddedRecipientStartURL : This is a sender provided valid URL string for redirecting an embedded recipient. When using this option, the embedded recipient still receives an email from DocuSign, just as a remote recipient would, but when the document link in the email is clicked the recipient is redirected, through DocuSign, to this URL to complete their actions. When routing to the URL, it is up to the sender’s system (the server responding to the URL) to then request a recipient token to launch a signing session.
Here is a sample createEnvelope request
{
"emailSubject": "Please sign the agreement",
"status": "sent",
"recipients": {
"signers": [
{
"email": "janedoe@acme.com",
"name": "jane doe",
"recipientId": 1,
"clientUserId":"1234",
"embeddedRecipientStartURL":"<Add Url to your App here>",
"tabs": {"signHereTabs": [{ "documentId": "1", "pageNumber": "1", "xPosition": "80", "yPosition": "80"}]}
}
]
},
"documents": [{ "documentId": "1", "name": "Contract", "fileExtension": "txt", "documentBase64": "RG9jIFRXTyBUV08gVFdP" }]
}
When the recipient clicks the link in their email, he is redirected to the url that you specify in embeddedRecipientStartURL. After your app authenticates and identifies the recipient, You will then have to request a recipient token using the CreateRecipientView api and specify the url for the custom thank you page in the returnUrl
parameter. Make sure you include https://
{
"email": "janedoe@acme.com",
"userName": "jane doe",
"recipientId": 1,
"clientUserId":"1234",
"returnUrl":"https://www.google.com", //Include your custom thank you page here
"AuthenticationMethod" :"email"
}
Also see this answer