Skip to content

Commit 68539a0

Browse files
authored
Merge pull request #150 from docusign/feature/embedded-sending-update
Embedded sending example updates
2 parents 3d43624 + d2980ee commit 68539a0

File tree

3 files changed

+43
-9
lines changed

3 files changed

+43
-9
lines changed

app/eSignature/examples/eg011_embedded_sending.py

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import base64
22
from os import path
33

4-
from docusign_esign import EnvelopesApi, ReturnUrlRequest, EnvelopesApi, EnvelopeDefinition, \
5-
Document, Signer, CarbonCopy, SignHere, Tabs, Recipients
4+
from docusign_esign import EnvelopesApi, EnvelopesApi, EnvelopeDefinition, \
5+
Document, Signer, CarbonCopy, SignHere, Tabs, Recipients, EnvelopeViewRequest, EnvelopeViewSettings, \
6+
EnvelopeViewRecipientSettings, EnvelopeViewDocumentSettings, EnvelopeViewTaggerSettings, EnvelopeViewTemplateSettings
67
from flask import url_for, session, request
78

89
from ...consts import pattern, demo_docs_path
@@ -36,6 +37,7 @@ def get_args():
3637
"access_token": session["ds_access_token"],
3738
"envelope_args": envelope_args,
3839
"ds_return_url": url_for("ds.ds_return", _external=True),
40+
"starting_view": starting_view,
3941
}
4042
return args
4143

@@ -58,23 +60,55 @@ def worker(cls, args, doc_docx_path, doc_pdf_path):
5860
@classmethod
5961
#ds-snippet-start:eSign11Step3
6062
def create_sender_view(cls, args, envelope_id):
61-
view_request = ReturnUrlRequest(return_url=args["ds_return_url"])
63+
view_request = cls.make_envelope_view_request(args)
6264
# Exceptions will be caught by the calling function
6365
api_client = create_api_client(base_path=args["base_path"], access_token=args["access_token"])
6466

6567
envelope_api = EnvelopesApi(api_client)
6668
sender_view = envelope_api.create_sender_view(
6769
account_id=args["account_id"],
6870
envelope_id=envelope_id,
69-
return_url_request=view_request
71+
envelope_view_request=view_request
7072
)
7173

7274
# Switch to Recipient and Documents view if requested by the user
7375
url = sender_view.url
74-
if args["starting_view"] == "recipient":
75-
url = url.replace("send=1", "send=0")
7676

7777
return url
78+
79+
@classmethod
80+
def make_envelope_view_request(cls, args):
81+
view_request = EnvelopeViewRequest(
82+
return_url=args["ds_return_url"],
83+
view_access="envelope",
84+
settings=EnvelopeViewSettings(
85+
starting_screen=args["starting_view"],
86+
send_button_action="send",
87+
show_back_button="false",
88+
back_button_action="previousPage",
89+
show_header_actions="false",
90+
show_discard_action="false",
91+
lock_token="",
92+
recipient_settings=EnvelopeViewRecipientSettings(
93+
show_edit_recipients="false",
94+
show_contacts_list="false"
95+
),
96+
document_settings=EnvelopeViewDocumentSettings(
97+
show_edit_documents="false",
98+
show_edit_document_visibility="false",
99+
show_edit_pages="false"
100+
),
101+
tagger_settings=EnvelopeViewTaggerSettings(
102+
palette_sections="default",
103+
palette_default="custom"
104+
),
105+
template_settings=EnvelopeViewTemplateSettings(
106+
show_matching_templates_prompt="true"
107+
)
108+
)
109+
)
110+
111+
return view_request
78112
#ds-snippet-end:eSign11Step3
79113

80114
@classmethod

app/templates/eSignature/eg011_embedded_sending.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<div class="form-group">
1818
<label for="starting_view">{{ example['Forms'][recipient_form_index]['Inputs'][starting_view_index]['InputName'] }}</label>
1919
<select id="starting_view" name="starting_view" class="form-control">
20-
<option value="tagging" selected>Tagging view</option>
21-
<option value="recipient">Recipient &amp; Documents view</option>
20+
<option value="Tagger" selected>Tagging view</option>
21+
<option value="Prepare">Prepare view</option>
2222
</select>
2323
</div>
2424
<div class="form-group">

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cffi==1.15.1
44
chardet==5.1.0
55
Click
66
cryptography==39.0.0
7-
docusign-esign==3.26.0rc1
7+
docusign-esign==4.0.0rc1
88
docusign-rooms==1.3.0
99
docusign-monitor==1.2.0
1010
docusign-click==1.4.0

0 commit comments

Comments
 (0)