@@ -12,18 +12,19 @@ def worker
1212 # Create the envelope request object
1313 envelope_definition = make_envelope ( args [ :envelope_args ] )
1414
15- # Step 3. Create and send the envelope
15+ # Create and send the envelope
1616 # Call Envelopes::create API method
1717 # Exceptions will be caught by the calling function
1818 envelope_api = create_envelope_api ( args )
19-
19+ # Step 3 start
2020 results = envelope_api . create_envelope args [ :account_id ] , envelope_definition
21+ # Step 3 end
2122 envelope_id = results . envelope_id
2223 { 'envelope_id' => envelope_id }
2324 end
2425
2526 private
26-
27+ # Step 2 start
2728 def make_envelope ( envelope_args )
2829 # document 1 (HTML) has tag **signature_1**
2930 # document 2 (DOCX) has tag /sn1/
@@ -35,7 +36,7 @@ def make_envelope(envelope_args)
3536 # The envelope will be sent first to the signer via SMS
3637 # After it is signed, a copy is sent to the cc person via SMS
3738
38- # Step 2. Create the envelope definition
39+ # Create the envelope definition
3940 envelope_definition = DocuSign_eSign ::EnvelopeDefinition . new
4041
4142 envelope_definition . email_subject = 'Please sign this document set'
@@ -75,43 +76,31 @@ def make_envelope(envelope_args)
7576 # The order in the docs array determines the order in the envelope
7677 envelope_definition . documents = [ document1 , document2 , document3 ]
7778
78- phone_number = DocuSign_eSign ::RecipientPhoneNumber . new
79- phone_number . country_code = envelope_args [ :country_code ]
80- phone_number . number = envelope_args [ :phone_number ]
81-
82- sms_notification = DocuSign_eSign ::RecipientAdditionalNotification . new
83- sms_notification . phone_number = phone_number
84- sms_notification . secondary_delivery_method = "SMS"
79+ signer_phone_number = DocuSign_eSign ::RecipientPhoneNumber . new
80+ signer_phone_number . country_code = envelope_args [ :country_code ]
81+ signer_phone_number . number = envelope_args [ :phone_number ]
8582
8683 # Create the signer recipient model
8784 signer1 = DocuSign_eSign ::Signer . new
88- signer1 . additional_notifications = [ sms_notification ]
89- signer1 . email = envelope_args [ :signer_email ]
85+ signer1 . phone_number = signer_phone_number
9086 signer1 . name = envelope_args [ :signer_name ]
9187 signer1 . recipient_id = '1'
9288 signer1 . routing_order = '1'
9389 ## routingOrder (lower means earlier) determines the order of deliveries
9490 # to the recipients. Parallel routing order is supported by using the
9591 # same integer as the order for two or more recipients
9692
97- # Create a RecipientPhoneNumber and add it to the additional SMS notification
9893 cc_phone_number = DocuSign_eSign ::RecipientPhoneNumber . new
9994 cc_phone_number . country_code = envelope_args [ :cc_country_code ]
10095 cc_phone_number . number = envelope_args [ :cc_phone_number ]
10196
102-
103- cc_sms_notification = DocuSign_eSign ::RecipientAdditionalNotification . new
104- cc_sms_notification . phone_number = cc_phone_number
105- cc_sms_notification . secondary_delivery_method = "SMS"
106-
10797 # Create a cc recipient to receive a copy of the documents
108- cc1 = DocuSign_eSign ::CarbonCopy . new (
109- email : envelope_args [ :cc_email ] ,
110- name : envelope_args [ :cc_name ] ,
111- routingOrder : '2' ,
112- recipientId : '2' ,
113- additionalNotifications : [ cc_sms_notification ]
114- )
98+ cc1 = DocuSign_eSign ::CarbonCopy . new
99+ cc1 . name = envelope_args [ :cc_name ]
100+ cc1 . routing_order = '2'
101+ cc1 . recipient_id = '2'
102+ cc1 . phone_number = cc_phone_number
103+
115104 # Create signHere fields (also known as tabs) on the documents
116105 # We're using anchor (autoPlace) positioning
117106 #
@@ -165,8 +154,8 @@ def create_document1(args)
165154margin-top: 0px;margin-bottom: 3.5em;font-size: 1em;
166155color: darkblue;\" >Order Processing Division</h2>
167156 <h4>Ordered by #{ args [ :signer_name ] } </h4>
168- <p style=\" margin-top:0em; margin-bottom:0em;\" >Email : #{ args [ :signer_email ] } </p>
169- <p style=\" margin-top:0em; margin-bottom:0em;\" >Copy to: #{ args [ :cc_name ] } , #{ args [ :cc_email ] } </p>
157+ <p style=\" margin-top:0em; margin-bottom:0em;\" >Phone number : #{ args [ :phone_number ] } </p>
158+ <p style=\" margin-top:0em; margin-bottom:0em;\" >Copy to: #{ args [ :cc_name ] } , #{ args [ :cc_phone_number ] } </p>
170159 <p style=\" margin-top:3em;\" >
171160 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.
172161 </p>
@@ -175,4 +164,5 @@ def create_document1(args)
175164 </body>
176165 </html>"
177166 end
178- end
167+ # Step 2 end
168+ end
0 commit comments