I'm trying to send an envelope after it is created because I'm adding a redirect url to recipients view.
I am unable to find a way to send the envelope except at createEnvelope function which depends on $envelop_definition->setStatus("sent")
;
I am using DocuSign PHP sdk
$envelop_definition = new DocuSign\eSign\Model\EnvelopeDefinition();
$envelop_definition->setEmailSubject($subject);
$envelop_definition->setTemplateId($templateid);
$envelop_definition->setTemplateRoles($templateRoles);
//$envelop_definition->setStatus("sent");
$options = new \DocuSign\eSign\Api\EnvelopesApi\CreateEnvelopeOptions();
$options->setCdseMode(null);
$options->setMergeRolesOnDraft(null);
// create and send the envelope (aka signature request)
$envelop_summary = $envelopeApi->createEnvelope($accountId, $envelop_definition, $options);
$envelop_summary = json_decode($envelop_summary);
if(!empty($envelop_summary)){
// set the returnURL
$envelope_id = $envelop_summary->envelopeId;
$url = 'http://www.mywebsite.com/docusign/helloworld.html?envelope_id=' . $envelope_id;
foreach ($recipients->getSigners() as $recipient) {
$recipient_view_request = new \DocuSign\eSign\Model\RecipientViewRequest();
// set where the recipient is re-directed once they are done signing
recipient_view_request->setReturnUrl($url);
}
Sure you just need to call the Envelopes: update API with the envelope status
set to sent
. The raw API request looks like:
PUT /v2/accounts/{accountId}/envelopes/{envelopeId}
{
"status": "sent"
}
DocuSign PHP SDK用户:
$envelopeApi->update($accountId, $envelope_id, json_encode(['status' => 'sent']));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.