Skip to content

Commit cb1d6bf

Browse files
authored
Merge pull request #161 from docusign/feature/embedded-sending-update
Embedded sending example updates
2 parents bcee96a + c82942a commit cb1d6bf

File tree

4 files changed

+55
-21
lines changed

4 files changed

+55
-21
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ end
7070

7171
gem 'docusign_admin', '~> 1.3.0'
7272
gem 'docusign_click', '~> 1.4.0'
73-
gem 'docusign_esign', '~> 3.27.0.rc1'
73+
gem 'docusign_esign', '~> 4.0.0.rc1'
7474
gem 'docusign_maestro', '~> 1.0.0.rc1'
7575
gem 'docusign_monitor', '~> 1.2.0'
7676
gem 'docusign_rooms', '~> 1.3.0'

Gemfile.lock

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ GEM
7272
io-like (~> 0.3.0)
7373
ast (2.4.2)
7474
base64 (0.2.0)
75+
bigdecimal (3.1.8)
7576
bindex (0.8.1)
7677
bootsnap (1.7.7)
7778
msgpack (~> 1.0)
@@ -110,7 +111,7 @@ GEM
110111
json (~> 2.1, >= 2.1.0)
111112
jwt (~> 2.2, >= 2.2.1)
112113
typhoeus (~> 1.0, >= 1.0.1)
113-
docusign_esign (3.27.0.rc1)
114+
docusign_esign (4.0.0.rc1)
114115
addressable (~> 2.7, >= 2.7.0)
115116
json (~> 2.1, >= 2.1.0)
116117
jwt (~> 2.2, >= 2.2.1)
@@ -143,7 +144,7 @@ GEM
143144
globalid (1.2.1)
144145
activesupport (>= 6.1)
145146
hashie (5.0.0)
146-
i18n (1.14.4)
147+
i18n (1.14.5)
147148
concurrent-ruby (~> 1.0)
148149
io-like (0.3.1)
149150
jbuilder (2.11.5)
@@ -165,14 +166,15 @@ GEM
165166
net-smtp
166167
marcel (1.0.4)
167168
matrix (0.4.2)
168-
method_source (1.0.0)
169+
method_source (1.1.0)
169170
mini_mime (1.1.5)
170171
minitest (5.22.3)
171172
msgpack (1.7.2)
172-
multi_xml (0.6.0)
173+
multi_xml (0.7.1)
174+
bigdecimal (~> 3.1)
173175
net-http (0.4.1)
174176
uri
175-
net-imap (0.4.10)
177+
net-imap (0.4.11)
176178
date
177179
net-protocol
178180
net-pop (0.1.2)
@@ -181,10 +183,10 @@ GEM
181183
timeout
182184
net-smtp (0.5.0)
183185
net-protocol
184-
nio4r (2.7.1)
185-
nokogiri (1.16.3-x64-mingw-ucrt)
186+
nio4r (2.7.3)
187+
nokogiri (1.16.5-x64-mingw-ucrt)
186188
racc (~> 1.4)
187-
nokogiri (1.16.3-x86_64-linux)
189+
nokogiri (1.16.5-x86_64-linux)
188190
racc (~> 1.4)
189191
oauth2 (2.0.9)
190192
faraday (>= 0.17.3, < 3.0)
@@ -200,11 +202,11 @@ GEM
200202
omniauth-oauth2 (1.8.0)
201203
oauth2 (>= 1.4, < 3)
202204
omniauth (~> 2.0)
203-
omniauth-rails_csrf_protection (1.0.1)
205+
omniauth-rails_csrf_protection (1.0.2)
204206
actionpack (>= 4.2)
205207
omniauth (~> 2.0)
206208
parallel (1.24.0)
207-
parser (3.3.0.5)
209+
parser (3.3.1.0)
208210
ast (~> 2.4.1)
209211
racc
210212
power_assert (2.0.3)
@@ -258,7 +260,7 @@ GEM
258260
rb-fsevent (0.11.2)
259261
rb-inotify (0.10.1)
260262
ffi (~> 1.0)
261-
regexp_parser (2.9.0)
263+
regexp_parser (2.9.1)
262264
rexml (3.2.6)
263265
rubocop (1.48.1)
264266
json (~> 2.3)
@@ -270,8 +272,8 @@ GEM
270272
rubocop-ast (>= 1.26.0, < 2.0)
271273
ruby-progressbar (~> 1.7)
272274
unicode-display_width (>= 2.4.0, < 3.0)
273-
rubocop-ast (1.31.2)
274-
parser (>= 3.3.0.4)
275+
rubocop-ast (1.31.3)
276+
parser (>= 3.3.1.0)
275277
ruby-progressbar (1.13.0)
276278
rubyzip (2.3.2)
277279
sass-rails (6.0.0)
@@ -335,7 +337,7 @@ GEM
335337
websocket-extensions (0.1.5)
336338
xpath (3.2.0)
337339
nokogiri (~> 1.8)
338-
zeitwerk (2.6.13)
340+
zeitwerk (2.6.14)
339341

340342
PLATFORMS
341343
x64-mingw-ucrt
@@ -349,7 +351,7 @@ DEPENDENCIES
349351
coffee-rails (~> 5.0.0)
350352
docusign_admin (~> 1.3.0)
351353
docusign_click (~> 1.4.0)
352-
docusign_esign (~> 3.27.0.rc1)
354+
docusign_esign (~> 4.0.0.rc1)
353355
docusign_maestro (~> 1.0.0.rc1)
354356
docusign_monitor (~> 1.2.0)
355357
docusign_rooms (~> 1.3.0)

app/services/e_sign/eg011_embedded_sending_service.rb

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ def worker
1919

2020
#ds-snippet-start:eSign11Step3
2121
# Create the sender view
22-
view_request = DocuSign_eSign::ReturnUrlRequest.new({ returnUrl: args[:ds_return_url] })
22+
view_request = envelope_view_request(args)
2323
envelope_api = create_envelope_api(args)
2424
results = envelope_api.create_sender_view args[:account_id], envelope_id, view_request
25-
# Switch to the Recipients/Documents view if requested by the user in the form
2625
url = results.url
27-
url = url.sub! 'send=1', 'send=0' if args[:starting_view] == 'recipient'
2826
{ 'envelope_id' => envelope_id, 'redirect_url' => url }
2927
#ds-snippet-end:eSign11Step3
3028
end
@@ -148,6 +146,40 @@ def make_envelope(envelope_args)
148146
envelope_definition
149147
end
150148

149+
#ds-snippet-start:eSign11Step3
150+
def envelope_view_request(args)
151+
DocuSign_eSign::EnvelopeViewRequest.new(
152+
returnUrl: args[:ds_return_url],
153+
viewAccess: 'envelope',
154+
settings: DocuSign_eSign::EnvelopeViewSettings.new(
155+
startingScreen: args[:starting_view],
156+
sendButtonAction: 'send',
157+
showBackButton: 'false',
158+
backButtonAction: 'previousPage',
159+
showHeaderActions: 'false',
160+
showDiscardAction: 'false',
161+
lockToken: '',
162+
recipientSettings: DocuSign_eSign::EnvelopeViewRecipientSettings.new(
163+
showEditRecipients: 'false',
164+
showContactsList: 'false'
165+
),
166+
documentSettings: DocuSign_eSign::EnvelopeViewDocumentSettings.new(
167+
showEditDocuments: 'false',
168+
showEditDocumentVisibility: 'false',
169+
showEditPages: 'false'
170+
),
171+
taggerSettings: DocuSign_eSign::EnvelopeViewTaggerSettings.new(
172+
paletteSections: 'default',
173+
paletteDefault: 'custom'
174+
),
175+
templateSettings: DocuSign_eSign::EnvelopeViewTemplateSettings.new(
176+
showMatchingTemplatesPrompt: 'true'
177+
)
178+
)
179+
)
180+
end
181+
#ds-snippet-end:eSign11Step3
182+
151183
def create_document1(args)
152184
"
153185
<!DOCTYPE html>

app/views/e_sign/eeg011_embedded_sending/get.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<div class="form-group">
1616
<label for="starting_view"><%= @example["Forms"][form_index]["Inputs"][view_index]["InputName"] %></label>
1717
<select id="starting_view" name="starting_view" class="form-control">
18-
<option value="tagging" selected>Tagging view</option>
19-
<option value="recipient">Recipient &amp; Documents view</option>
18+
<option value="Tagger" selected>Tagging view</option>
19+
<option value="Prepare">Prepare view</option>
2020
</select>
2121
</div>
2222
<div class="form-group">

0 commit comments

Comments
 (0)