How to add all signers name in email body in Docusign - docusignapi

I have to send Document to Signer1 and Signer2.In email template (In email body not in subject line) I need to add both signers name.If I use [[RecipientName]] includes only Signer1 name or Signer2 name not both.
How to achieve this with docusign..

So you want the email body to say
Hi Signer 1 and Signer 2, ...
You will need to explicitly set the "email blurb" for the envelope. Use the field emailBlurb in the envelopeDefinition of Envelopes: create
You can set the email body for all recipients (as shown above), or you can set different email bodies for each individual recipient.

Related

How to create dynamic document name in docusign template?

Have a docusign template and want the name of pdf document which is sent after completion to be dynamic.
currently its named as "Document"
want this to be named as "Document fullName" where fullName is a custom textTab
You could make an updateDocument call after sending the envelope to change the document name to include the recipients fullName. You cannot make this call after the envelope is Completed and has been signed. Therefore you'll need to do it before or immediately after you create the envelope. Best practice would be to set the desired document name before the envelope is sent.

UNKNOWN_ENVELOPE_RECIPIENT when creating recipient view for embedded signing

Out of many envelopes created, we have one where we cannot create the recipient view URL for embedded signing. In the sample test below, one of the two envelope IDs fail with
DocuSign.eSign.Client.ApiException : Error calling CreateRecipientView: {
"errorCode": "UNKNOWN_ENVELOPE_RECIPIENT",
"message": "The recipient you have identified is not a valid recipient of the specified
envelope."
}
while the other envevlope ID passes. Note we create the envelope with the ClientUserId and the Email set to the same value. We use the technique of setting the UserName to the values specified with GetRecipientsList (and always have), but yet it still fails, so this appears different from similar issues already answered.
[Theory]
[InlineData("redacted")]
[InlineData("redacted")]
public async Task ShouldCreateRecipientView(string envelopeId)
{
var accountId = await new DocuSignCredentials().GetDocuSignAccountIdAsync();
var envelopesApi = new EnvelopesApi();
var recipientList = await envelopesApi.ListRecipientsAsync(accountId, envelopeId);
Assert.Single(recipientList.Signers);
var signer = recipientList.Signers.First();
var viewOptions = new RecipientViewRequest()
{
ReturnUrl = "http://localhost/return",
ClientUserId = signer.Email,
AuthenticationMethod = "password",
UserName = signer.Name,
Email = signer.Email,
};
var viewUrl = await envelopesApi.CreateRecipientViewAsync(accountId, envelopeId, viewOptions);
}
Edit: if we set the viewOptions like the following, it still fails the same way. The control envelope ID continues to pass.
var viewOptions = new RecipientViewRequest()
{
ReturnUrl = "http://localhost/return",
AuthenticationMethod = "password",
ClientUserId = signer.ClientUserId,
Email = signer.Email,
UserId = signer.UserId,
RecipientId = signer.RecipientId
};
can you add the RecipientId to the RecipientViewRequest object? and make sure it matches what you used when creating the envelope? that should help identify which recipient you are looking for by the system.
This turns out to be Docusign bug with signature adoption.
Create an envelope for some recipient
The recipient signs a field, adopting a new signature and Full Name, and does a "finish later"
Create a second envelope for the same recipient using the exact same addressing parameters as the first envelope
The recipient signs the second envelope, and this is the critical part, adopts a second signature (while they can still see the first signature) with a different full name, and again does a "finish later"
The recipient attempts to open the first envelope; the embedded signing Create Recipient View will now fail with "unknown recipient" as the recipient info in the envelope doesn't reflect the latest Full Name attached to the recipient user id.
If your embedded signing code can figure out the latest Full Name that was adopted, and uses that for the UserName parameter when creating the recipient view, then it will work. But obtaining that latest Full Name is difficult due to authorization constraints.
The work around we are using is to force a new Docusign user id for every envelope by using a random string for the ClientUserId when creating the envelope. Not entirely satisfactory as the user signing experience is no longer optimal -- they have to accept the "electronic signature and records" terms on every envelope, and they won't be able to maintain a list of signatures. And it doesn't help for all the broken envelopes and the envelopes we have already created.
As kayjeta has noted, there's an edge case involving multiple in-flight envelopes and multiple signatures adopted for the same captive signer. The end result is an envelope where the GetEnvelopeRecipients call returns a name for the signer that doesn't match what's present in the envelope, resulting in a failing request for a recipient token.
To resolve this, the application can either:
1) Make the Recipient Token Request using the original name that was defined when the envelope was created
2) Take the results of the GetEnvelopeRecipients call and plug it in to an UpdateEnvelopeRecipients call to 'resync' the envelope and bring everything back in to alignment.
A Product Issue has been filed against this behavior. It's tracked internally as EC-1965.
If the captive recipient has not completed signing, the original recipient information will continue to work. If they have completed signing and you want to return them to the envelope at some subsequent point in time, then you will need to GET the now-updated name and use that for the recipient view API, OR you can get the userId and use that in place of name & email for all subsequent uses of "Recipient View". I recommend the latter approach as changes to the name by the signer does not affect the assigned "userId" value.

How do you change a signing user to a CarbonCopy user via the API?

I have a document with a number of signers attached, I would like to convert those people who haven't signed into CC recipients of the document via the API.
The first method I tried was to remove the signers and then add the CC recipients.
This doesn't work as by the time I add the CC recipients the document is complete and can't be modified.
If I add the CC recipients first removing the signers has the effect of removing the CC recipients as they share the same email address.
Method 2 should work but the API doesn't seem to distinguish between the type of recipient being removed.
$recipients = new Recipients();
$recipients->setCarbonCopies($ccRecipientsAdd->toArray());
$envelopeApi->createRecipient($accountId, $envelopeId, $recipients);
$recipients = new Recipients();
$recipients->setSigners($signersToRemove->toArray());
$envelopeApi->deleteRecipients($accountId, $envelopeId, $recipients);
Does anyone have any ideas?
You need to first add CC recipients with unique recipientId. Then you need to delete the signers who have not completed signing ceremony by signer's recipientId by calling
DELETE /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}
Since recipientId are different for Signers and CC recipients so removing Signer will not remove the CC recipient.

How to add PDFs to a draft envelope with "transformPdfFields": "true", so that DS assigns the tabs to the existing envelope recipients?

The customer wants to add multiple documents to an envelope. We need to add the documents one at a time due to their large size. The PDFs have Adobe fields in them
• We create a draft envelope with 2 signers
• We then use PUT /restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/documents for the PDF documents with "transformPdfFields": "true", but on transformation, DocuSign is creating new recipients as the placeholder recipients. The pdf fields are getting assigned to the placeholder recipients.
• Problem: we want to use the recipients already present in the draft envelope.
• Is there a way to add a document to a draft envelope with "transformPdfFields": "true", so that DocuSign assigns the new tabs to the recipients already present in the draft envelope?
During addition of the document. the transformed fields cannot be assigned to an existing recipient.
However you can make additional calls and reassign the tabs.
Get all the recipients and tabs using the listEnvelopeRecipients api. Specify the include_tabs = true query string parameter.
From the above call get all the Tab ID's that were created from the Transformed Fields.
Also note the RecipientId of the main recipient and Placeholder recipient.
Use the UpdateEnvelopeRecipientTabs api to reassign the recipients.
PUT /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
RecipientId should be that of the main recipient to whom you want to assign the transformed fields.
Json Request
{
"textTabs": [
{
"tabId": "1c8ff655-d8c3-4354-b4f2-0bbc4ed73148"
},
{
"tabId": "b861f00e-7f08-4e2f-ab67-c7ea36641aae"
}
]
}
Delete the place holder recipient that was created during the addition of the document using the DeleteEnvelopeRecipients api.
DELETE /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}

Add more signers to a signed document

I need to do this use case:
create a Docusign envelope with one signer
let the signer sign the document through embedded signing
add another signer to the document, and let the other signer sign it too
Reason: it might take some time for the 2nd company to sign the document, and the exact person to sign it might not be known at the beginning yet.
There's at least two ways to solve for this but possibly others too.
The first method is using one of the pre-built Recipient Types such as Agent or Editors or Intermediaries. These recipient types have varying capabilities (i.e. some can add tabs, docs, etc. to the envelopes) but the one thing they all have in common is that they can edit recipient information such as Name and Email address for recipients that come later in the routing order.
Another method for handling this which is a slight hack but still doable is to add two recipients with routing orders 1 and 2 to the envelope at the start, the first one is the recipient whose information you already know but for the second recipient you add a fake name and a fake email address. Once the first recipient signs the request technically gets sent to the "dummy" recipient but since it's a fake email it never gets sent to anyone. THEN, once you finally know who the second recipient is you can do an Envelope Correction and replace the dummy recipient with the real name and email.

Resources