简体   繁体   English

可选的收件人角色模板文档

[英]Optional recipient role template docusign

I created a template by the UI, and use it to create envelopes through the rest API.我通过 UI 创建了一个模板,并使用它通过 rest API 创建信封。 So far so good.到目前为止,一切都很好。

In the template, 4 roles were created.在模板中,创建了 4 个角色。 But one of these should be optional when creating the envelope, that is, in certain envelopes there will only be 3 signers.但是其中一个在创建信封时应该是可选的,也就是说,在某些信封中只有 3 个签名者。

The problem is that if I only send information for 3 templatesroles the docusign returns an error of INVALID_EMAIL_ADDRESS_FOR_RECIPIENT, for the role that was not informed.问题是,如果我只发送 3 个模板角色的信息,则文档会针对未通知的角色返回 INVALID_EMAIL_ADDRESS_FOR_RECIPIENT 错误。

My question is if there is a way to create a "optional" role in template.我的问题是是否有办法在模板中创建“可选”角色。 Which will only be informed in some envelopes.只会在一些信封中通知。

Edit:编辑:

I'm creating the envelope with the status "created".我正在创建状态为“已创建”的信封。 I do that bc we have to add some documents to the envelope before sending.我这样做是因为我们必须在发送之前在信封中添加一些文件。 After that I update the envelope changing the status to "sent".之后,我更新信封,将状态更改为“已发送”。

The error happens when I update the status to "sent".当我将状态更新为“已发送”时会发生错误。 If I create the envelope already with the "sent" status the error doesn't happens.如果我已经创建了“已发送”状态的信封,则不会发生错误。

Here's my code:这是我的代码:

 $result = Docusign::createEnvelope(array(
        'templateId' => $saleContract->obra->template_id,
        'emailSubject' => 'Contrato de Compra - ' . $saleContract->obra->nome_fantasia,
        'status' => 'created',
        'templateRoles' => $this->getRoles($saleContract, $tabs),
    ));

   $this->addDocuments($saleContract, $result['envelopeId']);

    //HERE IS WHERE THE ERROR HAPPENS
    Docusign::updateEnvelope($result['envelopeId'], ['status' => 'sent']);

By default, template roles are optional.默认情况下,模板角色是可选的。 This means that you can successfully do the following:这意味着您可以成功执行以下操作:

  • Create a single template that contains the maximum number of recipients (and fields/tabs for all recipients).创建一个包含最大收件人数(以及所有收件人的字段/选项卡)的模板。
  • Each time you create an Envelope via API, include Recipient information in the "Create Envelope" API request only for the needed recipients (Roles).每次通过 API 创建信封时,请在“创建信封”API 请求中仅包含所需收件人(角色)的收件人信息。

Any Recipient Roles that you do not specify information for when you POST /envelopes will not be included.将不包括您在 POST /envelopes 时未指定信息的任何收件人角色。 In the event you want to create your envelope in draft, make modifications, and then send, set the "merge roles on draft" qp to true.如果您想在草稿中创建信封、进行修改然后发送,请将“草稿上的合并角色”qp 设置为 true。

merge_roles_on_draft    string  
When set to true, template roles will be merged, and empty recipients will be removed. This parameter applies when you create a draft envelope with multiple templates. (To create a draft envelope, the status field is set to created.)

If you're still having problems, double-check that you haven't prepopulated your template role with name or email values.如果您仍然遇到问题,请仔细检查您是否没有使用名称或 email 值预先填充模板角色。 That will fudge up the merge ^这将捏造合并^

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

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