Skip to content

Commit 597ed4d

Browse files
authored
SMS delivery update (#59)
* update to sms delivery * fixing html doc
1 parent a9e21ac commit 597ed4d

4 files changed

Lines changed: 8 additions & 39 deletions

File tree

app/eSignature/examples/eg037_sms_delivery.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
SignHere,
1111
Tabs,
1212
Recipients,
13-
RecipientPhoneNumber,
14-
RecipientAdditionalNotification,
13+
RecipientPhoneNumber
1514
)
1615

1716
from flask import session, request
@@ -28,19 +27,15 @@ def get_args():
2827

2928
# More data validation would be a good idea here
3029
# Strip anything other than characters listed
31-
signer_email = pattern.sub("", request.form.get("signer_email"))
3230
signer_name = pattern.sub("", request.form.get("signer_name"))
33-
cc_email = pattern.sub("", request.form.get("cc_email"))
3431
cc_name = pattern.sub("", request.form.get("cc_name"))
3532
cc_phone_number = request.form.get("cc_phone_number")
3633
cc_country_code = request.form.get("country_code")
3734
phone_number = request.form.get("phone_number")
3835
country_code = request.form.get("country_code")
3936
envelope_args = {
40-
"signer_email": signer_email,
4137
"signer_name": signer_name,
4238
"status": "sent",
43-
"cc_email": cc_email,
4439
"cc_name": cc_name,
4540
"country_code": country_code,
4641
"phone_number": phone_number,
@@ -127,23 +122,17 @@ def make_envelope(cls, args):
127122
# The order in the docs array determines the order in the envelope
128123
env.documents = [document1, document2, document3]
129124

130-
phoneNumber = RecipientPhoneNumber(
125+
signerPhoneNumber = RecipientPhoneNumber(
131126
country_code=args["country_code"],
132127
number=args["phone_number"]
133128
)
134129

135-
sms_notification = RecipientAdditionalNotification(
136-
phone_number=phoneNumber
137-
)
138-
sms_notification.secondary_delivery_method = "SMS"
139-
140130
# Create the signer recipient model
141131
signer1 = Signer(
142-
email=args["signer_email"],
143132
name=args["signer_name"],
144133
recipient_id="1",
145134
routing_order="1",
146-
additional_notifications=[sms_notification]
135+
phone_number=signerPhoneNumber
147136
)
148137

149138
# Create a RecipientPhoneNumber and add it to the additional SMS notification
@@ -152,18 +141,12 @@ def make_envelope(cls, args):
152141
number=args["cc_phone_number"]
153142
)
154143

155-
cc_sms_notification = RecipientAdditionalNotification(
156-
phone_number=ccPhoneNumber
157-
)
158-
cc_sms_notification.secondary_delivery_method = "SMS"
159-
160144
# Create a cc recipient to receive a copy of the documents
161145
cc1 = CarbonCopy(
162-
email=args["cc_email"],
163146
name=args["cc_name"],
164147
recipient_id="2",
165148
routing_order="2",
166-
additional_notifications=[cc_sms_notification]
149+
phone_number=ccPhoneNumber
167150
)
168151

169152
# routingOrder (lower means earlier) determines the order of deliveries
@@ -222,8 +205,8 @@ def create_document1(cls, args):
222205
margin-top: 0px;margin-bottom: 3.5em;font-size: 1em;
223206
color: darkblue;">Order Processing Division</h2>
224207
<h4>Ordered by {args["signer_name"]}</h4>
225-
<p style="margin-top:0em; margin-bottom:0em;">Email: {args["signer_email"]}</p>
226-
<p style="margin-top:0em; margin-bottom:0em;">Copy to: {args["cc_name"]}, {args["cc_email"]}</p>
208+
<p style="margin-top:0em; margin-bottom:0em;">Phone Number: {args["phone_number"]}</p>
209+
<p style="margin-top:0em; margin-bottom:0em;">Copy to: {args["cc_name"]}</p>
227210
<p style="margin-top:3em;">
228211
Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie.
229212
Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée.

app/eSignature/views/eg037_sms_delivery.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,5 @@ def get_view():
5454
source_url=DS_CONFIG["github_example_url"] + "eg037_sms_delivery.py",
5555
documentation=DS_CONFIG["documentation"] + eg,
5656
show_doc=DS_CONFIG["documentation"],
57-
signer_name=DS_CONFIG["signer_name"],
58-
signer_email=DS_CONFIG["signer_email"]
57+
signer_name=DS_CONFIG["signer_name"]
5958
)

app/templates/eg037_sms_delivery.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ <h4>37. Request a signature by SMS delivery</h4>
2929
aria-describedby="accessHelp" placeholder="415-555-1212" required
3030
<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>
3131
</div>
32-
<div class="form-group">
33-
<label for="signer_email">Signer Email</label>
34-
<input type="email" class="form-control" id="signer_email" name="signer_email"
35-
aria-describedby="emailHelp" placeholder="pat@example.com" required
36-
value="{{ signer_email }}">
37-
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
38-
</div>
3932
<div class="form-group">
4033
<label for="signer_name">Signer Name</label>
4134
<input type="text" class="form-control" id="signer_name" placeholder="Pat Johnson" name="signer_name"
@@ -53,12 +46,6 @@ <h4>37. Request a signature by SMS delivery</h4>
5346
aria-describedby="accessHelp" placeholder="415-555-1212" required
5447
<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>
5548
</div>
56-
<div class="form-group">
57-
<label for="cc_email">CC Email</label>
58-
<input type="email" class="form-control" id="cc_email" name="cc_email"
59-
aria-describedby="emailHelp" placeholder="pat@example.com" required />
60-
<small id="emailHelp" class="form-text text-muted">The email for the cc recipient must be different from the signer's email.</small>
61-
</div>
6249
<div class="form-group">
6350
<label for="cc_name">CC Name</label>
6451
<input type="text" class="form-control" id="cc_name" placeholder="Pat Johnson" name="cc_name"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cffi==1.14.3
44
chardet==3.0.4
55
Click
66
cryptography==3.3.2
7-
docusign-esign==3.13.0
7+
docusign-esign==3.14.0
88
docusign-rooms==1.1.0
99
docusign-monitor==1.0.0
1010
docusign-click==1.0.0

0 commit comments

Comments
 (0)