php - 如何在创建信封时预先填写输入字段并通过复合模板传递相同的内容
问题描述
我一直在尝试通过调用服务器模板并添加带有值的选项卡来将数据预填充到管理员在模板创建期间创建的表单字段中
我找到了这个链接:在创建信封时传递模板选项卡值 从签名文档中检索信息 DocuSign API
但这并没有多大帮助,因为我正在尝试如下所示的 php 代码:
$signer1 = new \DocuSign\eSign\Model\Signer([
'email' => $signer_email, 'name' => $signer_name,
'role_name' => "signer", 'recipient_id' => "1",
'client_user_id' => $clientUserId,
'defaultrecipient'=> "true",
'tabs' => new \DocuSign\eSign\Model\Tabs( [
'textTabs' => new \DocuSign\eSign\Model\Text ([
'tabLabel' => "dob",
'value'=> "12/3/1998"
])
])
]);
$recipients_server_template = new \DocuSign\eSign\Model\Recipients([
'signers' => [$signer1]]);
$comp_template1 = new \DocuSign\eSign\Model\CompositeTemplate([
'composite_template_id' => "1",
'server_templates' => [
new \DocuSign\eSign\Model\ServerTemplate([
'sequence' => "1", 'template_id' => '6ef9c9c2-2f15-4a80-9643-f3c5a310dcdc'])
],
'inline_templates' => [
new \DocuSign\eSign\Model\InlineTemplate([
'sequence' => "1",
'recipients' => $recipients_server_template])
],
]);
$envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition([
'email_subject' => "Please sign this document",
//'documents' => [$comp_template1], # The order in the docs array determines the order in the envelope
'composite_templates' => [$comp_template1],
/*'recipients' => new DocuSign\eSign\Model\Recipients(['signers' => [$signer]]), */
'status' => "sent"
]);
正如您在上面看到的,“dob”是我在服务器模板中创建的自定义字段,并从那里提取并使用上面的代码我只想为其分配一个值。但是当我访问文档演示站点时,它并没有被填充。
我做错什么了吗??
非常感谢任何帮助,谢谢
解决方案
我自己今天一直在做类似的事情,发现以下解决方案似乎有效。
$textTabArray = array(array('tabLabel' => "regnum", 'value' => "testy"));
$taber = array("textTabs" => $textTabArray);
//for me tabs were in a different method
'tabs' => $taber
我使用了一种稍微不同的方法,使用了 PHP OAuth 并在此处找到了签名:
https://github.com/docusign/eg-03-php-auth-code-grant/blob/master/src/EG009UseTemplate.php
向签名者和模板角色模型添加选项卡。
希望有帮助!
推荐阅读
- c++ - 从指针向量、二维指针数组中删除对象并在一个循环中释放其内存
- c - 当我有 AF_UNIX 的 socket() 时,为什么我需要 socketpair()?
- c# - 如何在 C# 控制台应用程序搜索功能中搜索 SQL Server 表?
- python - 在 Product/Inventory 类应用程序中获取 <__main__.Product at 0x7fdbcc6c4460>] 错误
- excel - 查找命名范围或命名对象
- python - 空输出文件,Detectron2
- excel - 使用 VBA 获取网站的 HTML 代码(不使用 Selenium)
- android - 'flutter pub get' 失败 - “所以,因为 fstore 依赖于来自 sdk 的 flutter_test any,版本解析失败。”
- c - 打印和处理具有特定字符编码的文件
- javascript - 客户端切换设备或在浏览器中打开新会话时,Firebase Cloud Messaging 的客户端 ID 是否更改