@@ -58,34 +58,42 @@ def worker(cls, args):
5858 """
5959
6060 # Construct your API headers
61+ # Step 2 start
6162 api_client = create_api_client (base_path = args ["base_path" ], access_token = args ["access_token" ])
63+ # Step 2 end
6264
6365 # Submit a bulk list
66+ # Step 3-1 start
6467 bulk_envelopes_api = BulkEnvelopesApi (api_client )
6568 bulk_sending_list = cls .create_bulk_sending_list (args ["signers" ])
6669 bulk_list = bulk_envelopes_api .create_bulk_send_list (
6770 account_id = args ["account_id" ],
6871 bulk_sending_list = bulk_sending_list
6972 )
7073 bulk_list_id = bulk_list .list_id
74+ # Step 3-1 end
7175
7276 # Create an envelope
77+ # Step 4-1 start
7378 envelope_api = EnvelopesApi (api_client )
7479 envelope_definition = cls .make_draft_envelope ()
7580 envelope = envelope_api .create_envelope (account_id = args ["account_id" ], envelope_definition = envelope_definition )
7681 envelope_id = envelope .envelope_id
82+ # Step 4-1 end
7783
7884 # Attach your bulk list id to the envelope
85+ # Step 5 start
7986 text_custom_fields = TextCustomField (name = "mailingListId" , required = "false" , show = "false" , value = bulk_list_id )
8087 custom_fields = CustomFields (list_custom_fields = [], text_custom_fields = [text_custom_fields ])
8188 envelope_api .create_custom_fields (
8289 account_id = args ["account_id" ],
8390 envelope_id = envelope_id ,
8491 custom_fields = custom_fields
8592 )
93+ # Step 5 end
8694
8795 # Add placeholder tabs
88-
96+ # Step 6 start
8997 recipient_sign_here = SignHere (
9098 anchor_string = "/sn1/" ,
9199 anchor_units = "pixels" ,
@@ -126,21 +134,28 @@ def worker(cls, args):
126134 envelope_id = envelope_id ,
127135 recipients = Recipients (signers = [signer , cc ])
128136 )
137+ # Step 6 end
129138
130139 # Initiate bulk send
140+ # Step 7 start
131141 bulk_send_request = BulkSendRequest (envelope_or_template_id = envelope_id )
132142 batch = bulk_envelopes_api .create_bulk_send_request (
133143 account_id = args ["account_id" ],
134144 bulk_send_list_id = bulk_list_id ,
135145 bulk_send_request = bulk_send_request
136146 )
137147 batch_id = batch .batch_id
148+ # Step 7 end
138149
139150 # Confirm successful batch send
151+ # Step 8 start
140152 response = bulk_envelopes_api .get_bulk_send_batch_status (account_id = args ["account_id" ], bulk_send_batch_id = batch_id )
153+ # Step 8 end
154+ print (response )
141155
142156 return response
143157
158+ # Step 3-2 start
144159 @classmethod
145160 def create_bulk_sending_list (cls , args ):
146161 """
@@ -179,7 +194,9 @@ def create_bulk_sending_list(cls, args):
179194 )
180195
181196 return bulk_sending_list
197+ # Step 3-2 end
182198
199+ # Step 4-2 start
183200 @classmethod
184201 def make_draft_envelope (cls ):
185202 """
@@ -245,4 +262,5 @@ def make_draft_envelope(cls):
245262
246263 envelope_definition .recipients = Recipients (signers = [signer ], carbon_copies = [cc ])
247264
248- return envelope_definition
265+ return envelope_definition
266+ # Step 4-2 end
0 commit comments