Skip to content

Commit 9dbbef5

Browse files
Merge branch 'master' of github.com:docusign/code-examples-node-private
2 parents 41e4676 + 247f0c7 commit 9dbbef5

File tree

3 files changed

+7
-37
lines changed

3 files changed

+7
-37
lines changed

lib/eSignature/controllers/eg037SmsDelivery.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ eg037SmsDelivery.createController = async (req, res) => {
3838
// Step 2. Call the worker method
3939
const { body } = req;
4040
const envelopeArgs = {
41-
signerEmail: validator.escape(body.signerEmail),
4241
signerName: validator.escape(body.signerName),
4342
countryCode: validator.escape(body.countryCode),
4443
phoneNumber: validator.escape(body.phoneNumber),
45-
ccEmail: validator.escape(body.ccEmail),
4644
ccName: validator.escape(body.ccName),
4745
ccCountryCode: validator.escape(body.ccCountryCode),
4846
ccPhoneNumber: validator.escape(body.ccPhoneNumber),

lib/eSignature/examples/smsDelivery.js

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ const smsDelivery = async (args) => {
4545
*/
4646
function makeEnvelope(args) {
4747
// Data for this method
48-
// args.signerEmail
4948
// args.signerName
5049
// args.phoneNumber
5150
// args.countryCode
52-
// args.ccEmail
5351
// args.ccName
5452
// args.ccPhoneNumber
5553
// args.ccCountryCode
@@ -111,20 +109,15 @@ function makeEnvelope(args) {
111109
number: args.phoneNumber,
112110
});
113111

114-
// Create an additional notification for the signer
115-
let signerSmsNotification = new docusign.RecipientAdditionalNotification();
116-
signerSmsNotification.phoneNumber = signerPhoneNumber;
117-
signerSmsNotification.secondaryDeliveryMethod = "SMS";
118-
119-
// Create a signer recipient to sign the document, identified by name and email
112+
// Create a signer recipient to sign the document, identified by name and phone number
120113
// We're setting the parameters via the object constructor
121114
let signer1 = docusign.Signer.constructFromObject({
122-
email: args.signerEmail,
123115
name: args.signerName,
116+
phoneNumber: signerPhoneNumber,
124117
recipientId: "1",
125118
routingOrder: "1",
126119
});
127-
signer1.additionalNotifications = [signerSmsNotification];
120+
128121
// routingOrder (lower means earlier) determines the order of deliveries
129122
// to the recipients. Parallel routing order is supported by using the
130123
// same integer as the order for two or more recipients.
@@ -135,19 +128,13 @@ function makeEnvelope(args) {
135128
number: args.ccPhoneNumber,
136129
});
137130

138-
// Create an additional notification for the signer
139-
let ccSmsNotification = new docusign.RecipientAdditionalNotification();
140-
ccSmsNotification.phoneNumber = ccPhoneNumber;
141-
ccSmsNotification.secondaryDeliveryMethod = "SMS";
142-
143-
// Create a cc recipient to receive a copy of the documents, identified by name and email
131+
// Create a cc recipient to receive a copy of the documents, identified by name and phone number
144132
// We're setting the parameters via setters
145133
let cc1 = new docusign.CarbonCopy();
146-
cc1.email = args.ccEmail;
147134
cc1.name = args.ccName;
148135
cc1.routingOrder = "2";
149136
cc1.recipientId = "2";
150-
cc1.additionalNotifications = [ccSmsNotification];
137+
cc1.phoneNumber = ccPhoneNumber;
151138

152139
// Create signHere fields (also known as tabs) on the documents,
153140
// We're using anchor (autoPlace) positioning
@@ -198,9 +185,7 @@ function makeEnvelope(args) {
198185

199186
function document1(args) {
200187
// Data for this method
201-
// args.signerEmail
202188
// args.signerName
203-
// args.ccEmail
204189
// args.ccName
205190

206191
return `
@@ -216,8 +201,8 @@ function document1(args) {
216201
margin-top: 0px;margin-bottom: 3.5em;font-size: 1em;
217202
color: darkblue;">Order Processing Division</h2>
218203
<h4>Ordered by ${args.signerName}</h4>
219-
<p style="margin-top:0em; margin-bottom:0em;">Email: ${args.signerEmail}</p>
220-
<p style="margin-top:0em; margin-bottom:0em;">Copy to: ${args.ccName}, ${args.ccEmail}</p>
204+
<p style="margin-top:0em; margin-bottom:0em;">Phone number: ${args.phoneNumber}</p>
205+
<p style="margin-top:0em; margin-bottom:0em;">Copy to: ${args.ccName}, ${args.ccPhoneNumber}</p>
221206
<p style="margin-top:3em;">
222207
Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice cream gummies cheesecake.
223208
</p>

views/pages/examples/eg037SmsDelivery.ejs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@
2828
aria-describedby="accessHelp" placeholder="415-555-1212" required
2929
<small id="accessHelp" class="form-text text-muted">This phone number will receive a notification. We'll never share your phone number with anyone else.</small>
3030
</div>
31-
<div class="form-group">
32-
<label for="signerEmail">Signer Email</label>
33-
<input type="email" class="form-control" id="signerEmail" name="signerEmail"
34-
aria-describedby="emailHelp" placeholder="pat@example.com" required
35-
value="<%= locals.dsConfig.signerEmail %>">
36-
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
37-
</div>
3831
<div class="form-group">
3932
<label for="signerName">Signer Name</label>
4033
<input type="text" class="form-control" id="signerName" placeholder="Pat Johnson" name="signerName"
@@ -52,12 +45,6 @@
5245
aria-describedby="accessHelp" placeholder="415-555-1212" required
5346
<small id="accessHelp" class="form-text text-muted">This phone number will receive a notification. We'll never share your phone number with anyone else.</small>
5447
</div>
55-
<div class="form-group">
56-
<label for="ccEmail">CC Email</label>
57-
<input type="email" class="form-control" id="ccEmail" name="ccEmail"
58-
aria-describedby="emailHelp" placeholder="pat@example.com" required
59-
<small id="emailHelp" class="form-text text-muted">The email for the cc recipient must be different from the signer's email.</small>
60-
</div>
6148
<div class="form-group">
6249
<label for="ccName">CC Name</label>
6350
<input type="text" class="form-control" id="ccName" placeholder="Pat Johnson" name="ccName"

0 commit comments

Comments
 (0)