Send embedded signing email with setting signing order

谁都会走 提交于 2019-12-25 00:52:54

问题


So basically I need to use embedded signing feature to get the URL and embed into my application, and then my customer can sign the document from my side. Apart from that, after my customer signed on the doc, he needs to ask his debtor to sign on the same doc as well. So on DocuSign UI, I found that I can set a signing order, which means the second recipient receives the email right after the first recipient signed (perfect match my requirement). setting on UI However, the second recipient can not receive the email after the first signer signed even though on UI it says sent.

public Envelope embeddedSigning(Long debtorId, String signerEmail, String signerName, String templateId) throws ApiException, IOException {
    // create an envelop
    EnvelopeDefinition envelope = makeEnvelope(debtorId, signerEmail, signerName, templateId);

    ApiClient apiClient = baseRestApiClient();
    apiClient.addDefaultHeader("Authorization", "Bearer " + getToken());
    EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
    EnvelopeSummary summary = envelopesApi.createEnvelope(accountId, envelope);
    RecipientViewRequest viewRequest = makeRecipientViewRequest(debtorId, signerEmail, signerName);
    ViewUrl viewUrl = envelopesApi.createRecipientView(accountId, summary.getEnvelopeId(), viewRequest);

    // @formatter:off
    return Envelope.builder()
        .envelopId(summary.getEnvelopeId())
        .redirectUrl(viewUrl.getUrl()).build();
    // @formatter:on
  }
private EnvelopeDefinition makeEnvelope(Long debtorId, String signerEmail, String signerName, String templateId) throws IOException {
    EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
    envelopeDefinition.setEmailSubject("Please sign this document");
    envelopeDefinition.setTemplateId(templateId);

    TemplateRole signer = new TemplateRole();
    signer.setEmail(signerEmail);
    signer.setName(signerName);
    signer.clientUserId(String.valueOf(debtorId));
    signer.setRoleName("signer0");
    signer.setRoutingOrder("1");

    TemplateRole signer1 = new TemplateRole();
    signer1.setEmail("xxx");
    signer1.setName("xxx");
    signer1.clientUserId(String.valueOf(xxx));
    signer1.setRoleName("signer1");
    signer1.setRoutingOrder("2");

    envelopeDefinition.setTemplateRoles(Arrays.asList(signer, signer1));
    envelopeDefinition.setStatus("sent");
    return envelopeDefinition;
  }

回答1:


You are setting signer1.clientUserId(String.valueOf(xxx)); which means you are making signer an embedded signer. By Default, DocuSign does not send email to the embedded signer. By making a signer as embedded signer, you are telling DocuSign that calling App will take care of deciding when to host signing ceremony for this signer so DocuSign will not send an email as they will not be doing signing from the email, instead it be your App which will be generating Signing URL when that signer is on your App. So if you remove signer1.clientUserId(String.valueOf(xxx)); code then you will see that signer1 will get an email from DocuSign.

Docs has more details about embedded signing.




回答2:


Typically routing order starts at 1. so it should be 1 and 2, not 0 and 1. Apart from that, "Sent" is the status for the entire envelope. The envelope goes to routing order 1 first. Then, when all recipients of routing order 1 finished signing, it goes to 2 etc. I'm not sure if you actually have an issue here, but please confirm after you changed to 1 and 2 what exactly do you see that you don't expect.



来源:https://stackoverflow.com/questions/57098241/send-embedded-signing-email-with-setting-signing-order

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!