繁体   English   中英

Docusign API 使用 TemplateRole 发送带有 SMS 的信封

[英]Docusign API Sending an envelope with SMS using TemplateRole

这是关于 DocuSign Java 客户端库的。

使用 Docusign Java 客户端通过 SMS 发送信封的各种方法是什么? 我知道 com.docusign.esign.model.Signer class 中的com.docusign.esign.model.Signer setAdditionalNotifications()方法。 我可以在其中分配 com.docusign.esign.model.RecipientPhoneNumber 的com.docusign.esign.model.RecipientPhoneNumber But as per the code examples, if we are using an existing Template to create an envelope then we must use an object of com.docusign.esign.model.TemplateRole instead of Signer object. 由于我的应用程序使用模板而不是硬编码 PDF 作为文档,因此我正在TemplateRole class 中寻找类似setAdditionalNotifications()的方法。 但找不到任何东西。

使用现有模板发送带有 SMS 的信封的最佳方法是什么。 代码片段也会有所帮助。

通常,如果没有 SMS,您可以使用 TemplateRole,但如果您需要 SMS 通知,这将不起作用。 在这种情况下,您将不得不进行多次 API 调用。 首先 - 从模板创建信封。 没有其他的。 然后,您使用与下面类似的代码来更新收件人。 最后,通过第三个 API 调用发送它

/* example of signer and cc */
      Signer signer = new Signer();
      signer.setEmail(args.getSignerEmail());
      signer.setName(args.getSignerName());
      signer.setRecipientId("1");
      signer.setRoutingOrder("1");
      signer.setTabs(signerTabs);
    
      RecipientAdditionalNotification smsDelivery = new RecipientAdditionalNotification();
      smsDelivery.setSecondaryDeliveryMethod("SMS");
    
      RecipientPhoneNumber phoneNumber = new RecipientPhoneNumber();
      phoneNumber.setCountryCode(args.getCountryCode());
      phoneNumber.setNumber(args.getPhoneNumber());
      smsDelivery.phoneNumber(phoneNumber);
      signer.setAdditionalNotifications(Arrays.asList(smsDelivery));
          
       // Create a cc recipient to receive a copy of the documents, identified by name and email
      CarbonCopy cc = new CarbonCopy();
      cc.setEmail(args.getCcEmail());
      cc.setName(args.getCcName());
      cc.setRecipientId("2");
      cc.setRoutingOrder("2");
          
      RecipientAdditionalNotification ccSmsDelivery = new RecipientAdditionalNotification();
      ccSmsDelivery.setSecondaryDeliveryMethod("SMS");
          
      RecipientPhoneNumber ccPhoneNumber = new RecipientPhoneNumber();
      ccPhoneNumber.setCountryCode(args.getCcCountryCode());
      ccPhoneNumber.setNumber(args.getCcPhoneNumber());
      ccSmsDelivery.phoneNumber(ccPhoneNumber);
      cc.setAdditionalNotifications(Arrays.asList(ccSmsDelivery));
    
/* missing code - build recipients object and add items above */

      envelopesApi.UpdateRecipients(accountId, envelopeId, recipients);

暂无
暂无

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

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