2017-02-21 94 views
0

我試圖在創建信封之後發送信封,因爲我將重定向網址添加到收件人視圖。如何在使用PHP sdk創建後再發送docusign信封

我無法找到發送信封的方式,除了在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($帳戶ID,$ envelope_id); – smarmysam

回答

0

當然你只需要在信封status集調用Envelopes: update API來sent。原始API請求看起來像:

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

{ 
    "status": "sent" 
} 
0

的DocuSign PHP SDK用戶:

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