php - DocuSign API: initialHere and signHere on the same document...or not

I'm using anchored tabs on a document, and the signature piece works great. I saw on another post adding an initial tab is as simple as trading out "signhere" for "initialhere". Cool.
My first question: the easiest solution for me would be to add both signhere and initialhere for every recipient. It's my understanding that doing so wouldn't break anything: if the tab isn't on the document, then the role is simply ignored. Is that so?
My second question: do I create a new recipient (same person) for each role, or assign more than one role to the recipient? The downloaded sample code doesn't do anything with initials that I can find.
The code as it exists now, using the PHP SDK:
$sign_here = new \DocuSign\eSign\Model\SignHere(['anchor_string' => '{sig:1}']);
$signer_tabs = new \DocuSign\eSign\Model\Tabs(['sign_here_tabs' => [$sign_here]]);
$signer_props = [
'email' => $args['email'],
'name' => $args['name'],
'recipient_id' => count($this->arrSigners) + 1,
'role_name' => $args['role'],
'tabs' => $signer_tabs
];
# Create the signer recipient model
$this->arrSigners[] = new Signer($signer_props);
Answer
Solution:
You can add multiple types of tabs to a single recipient by adding them to the list of signer tabs. So after creating an InitialHere tab you would add it to your list like this:
$signer_tabs = new \DocuSign\eSign\Model\Tabs(['sign_here_tabs' => [$sign_here], 'initial_here_tabs' => [$initial_here]);
For your first question, if you add an Initial Here tab to the document with an anchor string that isn't in the document, then the tab will not appear and the recipient will not need to initial.
Answer
Solution:
if the tab isn't on the document, then the role is simply ignored. Is that so?
Yes, the role name will be ignored by your non-template envelope regardless of the tab being present or not.roleName
is used for matching your intended user to a given role within the signing process for a template envelope. When creating a template, you will specify a role name for the recipient, a carbon copy viewer, etc.
When creating your envelope using that template you just created, you will specify the role name for your given recipients so that the data will be matched to the templated role name. In other words - you will not use the template name to determine whether or not a given tab is used, but rather, to determine which user data is populated on envelope that is generated from using the template envelope.
My second question: do I create a new recipient (same person) for each role, or assign more than one role to the recipient? The downloaded sample code doesn't do anything with initials that I can find.
Not quite, you would need to create more of those sign_here objects and attach them into the signer_tabs array you listed up there, under a new array and entry named 'initial_here_tabs', like this:
$sign_here = new \DocuSign\eSign\Model\SignHere(['anchor_string' => '{sig:1}']);
$initial_here = new \DocuSign\eSign\Model\InitialHere(['anchor_string' => '{ini:1}']);
$signer_tabs = new \DocuSign\eSign\Model\Tabs([
'sign_here_tabs' => [$sign_here],
'initial_here_tabs' => [$initial_here]
]);
$signer_props = [
'email' => $args['email'],
'name' => $args['name'],
'recipient_id' => count($this->arrSigners) + 1,
'tabs' => $signer_tabs
];
# Create the signer recipient model
$this->arrSigners[] = new Signer($signer_props);
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: failed to create image decoder with message 'unimplemented'
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.