Skip to content

Commit

Permalink
Merge pull request #161 from docusign/feature/embedded-sending-update
Browse files Browse the repository at this point in the history
Embedded sending example updates
  • Loading branch information
paigesrossi authored May 16, 2024
2 parents bcee96a + c82942a commit cb1d6bf
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ end

gem 'docusign_admin', '~> 1.3.0'
gem 'docusign_click', '~> 1.4.0'
gem 'docusign_esign', '~> 3.27.0.rc1'
gem 'docusign_esign', '~> 4.0.0.rc1'
gem 'docusign_maestro', '~> 1.0.0.rc1'
gem 'docusign_monitor', '~> 1.2.0'
gem 'docusign_rooms', '~> 1.3.0'
Expand Down
32 changes: 17 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ GEM
io-like (~> 0.3.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.7.7)
msgpack (~> 1.0)
Expand Down Expand Up @@ -110,7 +111,7 @@ GEM
json (~> 2.1, >= 2.1.0)
jwt (~> 2.2, >= 2.2.1)
typhoeus (~> 1.0, >= 1.0.1)
docusign_esign (3.27.0.rc1)
docusign_esign (4.0.0.rc1)
addressable (~> 2.7, >= 2.7.0)
json (~> 2.1, >= 2.1.0)
jwt (~> 2.2, >= 2.2.1)
Expand Down Expand Up @@ -143,7 +144,7 @@ GEM
globalid (1.2.1)
activesupport (>= 6.1)
hashie (5.0.0)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-like (0.3.1)
jbuilder (2.11.5)
Expand All @@ -165,14 +166,15 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.22.3)
msgpack (1.7.2)
multi_xml (0.6.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-http (0.4.1)
uri
net-imap (0.4.10)
net-imap (0.4.11)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -181,10 +183,10 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.1)
nokogiri (1.16.3-x64-mingw-ucrt)
nio4r (2.7.3)
nokogiri (1.16.5-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
oauth2 (2.0.9)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -200,11 +202,11 @@ GEM
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (~> 2.0)
omniauth-rails_csrf_protection (1.0.1)
omniauth-rails_csrf_protection (1.0.2)
actionpack (>= 4.2)
omniauth (~> 2.0)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
power_assert (2.0.3)
Expand Down Expand Up @@ -258,7 +260,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.9.0)
regexp_parser (2.9.1)
rexml (3.2.6)
rubocop (1.48.1)
json (~> 2.3)
Expand All @@ -270,8 +272,8 @@ GEM
rubocop-ast (>= 1.26.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
sass-rails (6.0.0)
Expand Down Expand Up @@ -335,7 +337,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.13)
zeitwerk (2.6.14)

PLATFORMS
x64-mingw-ucrt
Expand All @@ -349,7 +351,7 @@ DEPENDENCIES
coffee-rails (~> 5.0.0)
docusign_admin (~> 1.3.0)
docusign_click (~> 1.4.0)
docusign_esign (~> 3.27.0.rc1)
docusign_esign (~> 4.0.0.rc1)
docusign_maestro (~> 1.0.0.rc1)
docusign_monitor (~> 1.2.0)
docusign_rooms (~> 1.3.0)
Expand Down
38 changes: 35 additions & 3 deletions app/services/e_sign/eg011_embedded_sending_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ def worker

#ds-snippet-start:eSign11Step3
# Create the sender view
view_request = DocuSign_eSign::ReturnUrlRequest.new({ returnUrl: args[:ds_return_url] })
view_request = envelope_view_request(args)
envelope_api = create_envelope_api(args)
results = envelope_api.create_sender_view args[:account_id], envelope_id, view_request
# Switch to the Recipients/Documents view if requested by the user in the form
url = results.url
url = url.sub! 'send=1', 'send=0' if args[:starting_view] == 'recipient'
{ 'envelope_id' => envelope_id, 'redirect_url' => url }
#ds-snippet-end:eSign11Step3
end
Expand Down Expand Up @@ -148,6 +146,40 @@ def make_envelope(envelope_args)
envelope_definition
end

#ds-snippet-start:eSign11Step3
def envelope_view_request(args)
DocuSign_eSign::EnvelopeViewRequest.new(
returnUrl: args[:ds_return_url],
viewAccess: 'envelope',
settings: DocuSign_eSign::EnvelopeViewSettings.new(
startingScreen: args[:starting_view],
sendButtonAction: 'send',
showBackButton: 'false',
backButtonAction: 'previousPage',
showHeaderActions: 'false',
showDiscardAction: 'false',
lockToken: '',
recipientSettings: DocuSign_eSign::EnvelopeViewRecipientSettings.new(
showEditRecipients: 'false',
showContactsList: 'false'
),
documentSettings: DocuSign_eSign::EnvelopeViewDocumentSettings.new(
showEditDocuments: 'false',
showEditDocumentVisibility: 'false',
showEditPages: 'false'
),
taggerSettings: DocuSign_eSign::EnvelopeViewTaggerSettings.new(
paletteSections: 'default',
paletteDefault: 'custom'
),
templateSettings: DocuSign_eSign::EnvelopeViewTemplateSettings.new(
showMatchingTemplatesPrompt: 'true'
)
)
)
end
#ds-snippet-end:eSign11Step3

def create_document1(args)
"
<!DOCTYPE html>
Expand Down
4 changes: 2 additions & 2 deletions app/views/e_sign/eeg011_embedded_sending/get.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<div class="form-group">
<label for="starting_view"><%= @example["Forms"][form_index]["Inputs"][view_index]["InputName"] %></label>
<select id="starting_view" name="starting_view" class="form-control">
<option value="tagging" selected>Tagging view</option>
<option value="recipient">Recipient &amp; Documents view</option>
<option value="Tagger" selected>Tagging view</option>
<option value="Prepare">Prepare view</option>
</select>
</div>
<div class="form-group">
Expand Down

0 comments on commit cb1d6bf

Please sign in to comment.