2017-02-21 2 views
0

Я пытаюсь отправить конверт после его создания, потому что я добавляю URL-адрес перенаправления для получателей.Как отправить конверт docusign позже после его создания с помощью PHP sdk

Я не могу найти способ отправки конверта, кроме функции createEnvelope, которая зависит от $envelop_definition->setStatus("sent");

Я использую 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); 
} 
+0

$ реципиентов = $ envelopeApi-> listRecipients ($ ACCOUNTID, $ envelope_id); – smarmysam

ответ

0

Конечно, вы просто должны вызвать Envelopes: update API с набором конверт status для sent. Запрос сырого API выглядит следующим образом:

PUT /v2/accounts/{accountId}/envelopes/{envelopeId} 

{ 
    "status": "sent" 
} 
0

DocuSign PHP SDK пользователи:

$envelopeApi->update($accountId, $envelope_id, json_encode(['status' => 'sent']));