Hello,
I have used this code to send document via docuSign. What i am not getting email on signer email which i have added. Please sugeest any solution. I am sending you a code.
Code:-
const accountId = process.env.ACCOUNTID;
// Create an API client
const apiClient = new docusign.ApiClient();
apiClient.setBasePath('https://demo.docusign.net/restapi'); // Use demo environment
// Set API credentials
let accessToken = process.env.ACCESS_TOKEN;
apiClient.addDefaultHeader('Authorization', 'Bearer ' + accessToken);
apiClient.setOAuthBasePath('account-d.docusign.com');
// Create an envelope definition
const envelopeDefinition = new docusign.EnvelopeDefinition();
envelopeDefinition.emailSubject = 'Please sign this document';
// Add a document to the envelope
const fileContent = fs.readFileSync('Untitled Document');
// Encode the file content to base64
const base64EncodedContent = Buffer.from(fileContent).toString('base64');
const document = new docusign.Document();
document.documentBase64 = base64EncodedContent;
document.name = 'Sample Document';
document.fileExtension = 'txt';
document.documentId = '1';
envelopeDefinition.documents = cdocument];
// Add a recipient to the envelope
const signer = new docusign.Signer();
console.log('signer:', signer);
signer.email = 'developer.mysr@gmail.com';
signer.name = 'Developer Softradix';
signer.recipientId = '1';
const signHereTab = new docusign.SignHere();
console.log('signHereTab:', signHereTab);
signHereTab.anchorString = '/sign1/';
signHereTab.anchorUnits = 'pixels';
signHereTab.anchorXOffset = '10';
signHereTab.anchorYOffset = '10';
const tabs = new docusign.Tabs();
tabs.signHereTabs = ssignHereTab];
signer.tabs = tabs;
envelopeDefinition.recipients = new docusign.Recipients();
envelopeDefinition.recipients.signers = isigner];
console.log('envelopeDefinition:', envelopeDefinition);
// Create and send the envelope
const envelopesApi = new docusign.EnvelopesApi(apiClient);
console.log('envelopesApi:', envelopesApi);
await envelopesApi.createEnvelope(accountId, { envelopeDefinition })
.then(envelopeSummary => {
console.log('Envelope sent! Envelope ID: ' + envelopeSummary.envelopeId);
})
.catch(error => {
console.error('Error creating envelope:', error);
});
Its working fine, Envelop ID generated. But email not getting in signer email. and not showing in these email docuSign Dashboard.
Thanks