Составной шаблон Docusign не принимается получателями, а отображается в папке входящих сообщений DS - PullRequest
0 голосов
/ 13 января 2020

Я следую рецепту, который можно найти здесь:

https://developers.docusign.com/esign-rest-api/code-examples/code-example-adding-document-template#run - пример

Но я обнаружил, что несмотря на то, что конверт отображается как отправлено на почтовый ящик docusign, получатели не получат его, вот код ...

const tabs = getTabsMethodWorkingForStandaloneTemplates({
    name: "name",
    email: "name@email.com"
});
// Create a signer recipient for the signer role of the server template
let signer1 = docusign.Signer.constructFromObject({
    email: args.signerEmail,
    name: args.signerName,
    roleName: "signer",
    recipientId: "1",
    // Adding clientUserId transforms the template recipient
    // into an embedded recipient:
    clientUserId: args.signerClientId,
    tabs
});

// Recipients object:
let recipientsServerTemplate = docusign.Recipients.constructFromObject({
    signers: [signer1],
});

// create a composite template for the Server Template
let compTemplate1 = docusign.CompositeTemplate.constructFromObject({
    compositeTemplateId: "1",
    serverTemplates: [
        docusign.ServerTemplate.constructFromObject({
            sequence: 1,
            templateId: args.templateId
        })
    ],
    // Add the roles via an inlineTemplate
    inlineTemplates: [
        docusign.InlineTemplate.constructFromObject({
            sequence: 1,
            recipients: recipientsServerTemplate
        })
    ]
});



//const compTemplate2 = getCompositeTemplateFromHTML(args);

const eventNotification = new docusign.EventNotification();
eventNotification.url = 'http://pj.pagekite.me';
eventNotification.includeDocuments = true;
eventNotification.loggingEnabled = true;
eventNotification.envelopeEvents = getEnvelopeEvents();

// create the envelope definition
let env = docusign.EnvelopeDefinition.constructFromObject({
    status: "sent",
    compositeTemplates: [
        compTemplate1,
    //  compTemplate2
    ],
    eventNotification
});

try {
    // Step 2. call Envelopes::create API method
    // Exceptions will be caught by the calling function
    let results = await envelopesApi.createEnvelope(
        args.accountId,
        {envelopeDefinition: env}
    );

    let envelopeId = results.envelopeId;
    console.log(`Envelope was created. EnvelopeId ${envelopeId}`);
} catch (e) {
    debugger
}

1 Ответ

1 голос
/ 13 января 2020

У вас там clientUserId. Это означает встроенную подпись. Удалите это, и электронное письмо будет отправлено для удаленной подписи. Эти два взаимоисключающие. Не может иметь их обоих.

...