繁体   English   中英

在使用PHP sdk创建文件之后,如何发送docusign信封

[英]How do you send a docusign envelope later after it is created using 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);
}

确保您只需要调用信封status为已sent的信封status 更新 API。 原始API请求如下所示:

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

{
    "status": "sent"
}

DocuSign PHP SDK用户:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM