Skip to content

Commit 461bc88

Browse files
Branding updates (#31)
* branding updates
1 parent 30f2d6b commit 461bc88

File tree

13 files changed

+36
-36
lines changed

13 files changed

+36
-36
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2023 DocuSign, Inc. (https://www.docusign.com)
3+
Copyright (c) 2024 Docusign, Inc. (https://www.docusign.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
### Github repo: MyConnectWebhookSampleApp
44

55
## Introduction
6-
MyConnectWebhook is a DocuSign sample application written in Ruby on Rails (server) and React (client). You can find a live instance running at [https://myconnectwebhook.sampleapps.docusign.com/](https://myconnectwebhook.sampleapps.docusign.com/).
6+
MyConnectWebhook is a Docusign sample application written in Ruby on Rails (server) and React (client). You can find a live instance running at [https://myconnectwebhook.sampleapps.docusign.com/](https://myconnectwebhook.sampleapps.docusign.com/).
77

88
MyConnectWebhook demonstrates the following:
99

10-
1. **Authentication** with DocuSign via [JSON Web Token (JWT) Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken).
10+
1. **Authentication** with Docusign via [JSON Web Token (JWT) Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken).
1111
2. **Bulk sending multiple envelopes:** ([Source](./app/services/e_sign/bulk_sending_envelopes_service.rb))
12-
This example uses the DocuSign [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/) to [Bulk Send](https://developers.docusign.com/docs/esign-rest-api/reference/bulkenvelopes/bulksend/) multiple envelopes based on PDF document template, and filling data dynamically.
12+
This example uses the Docusign [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/) to [Bulk Send](https://developers.docusign.com/docs/esign-rest-api/reference/bulkenvelopes/bulksend/) multiple envelopes based on PDF document template, and filling data dynamically.
1313
3. **Tracking user signing progress with the Docusign Connect webhook service.** After the request has been sent to Docusign, the app awaits for webhook requests from [Docusign Connect](https://developers.docusign.com/platform/webhooks/connect/) and displays the result on UI.
1414
4. **Elastic signing:** ([Source](./app/javascript/src/pages/automatedWorkflow/index.js))
15-
This example demonstates signing process of a DocuSign [elastic template](https://developers.docusign.com/docs/click-api/how-to/create-elastic-templates/) document.
15+
This example demonstates signing process of a Docusign [elastic template](https://developers.docusign.com/docs/click-api/how-to/create-elastic-templates/) document.
1616
5. **Sending out a confirmation envelope after a successful elastic signature:** ([Source](./app/services/e_sign/send_envelope_service.rb))
17-
This example uses the DocuSign [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/), demonstrating how to [create an envelope](https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/). The example sends an envelope based on PDF template.
17+
This example uses the Docusign [eSignature REST API](https://developers.docusign.com/docs/esign-rest-api/), demonstrating how to [create an envelope](https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/). The example sends an envelope based on PDF template.
1818

1919
## Prerequisites
2020

21-
* A DocuSign developer account. Create a [free account](https://go.docusign.com/o/sandbox/).
22-
* A DocuSign integration key (client ID) that is configured to use JSON Web Token (JWT) Grant.
21+
* A Docusign developer account. Create a [free account](https://go.docusign.com/o/sandbox/).
22+
* A Docusign integration key (client ID) that is configured to use JSON Web Token (JWT) Grant.
2323
You will need the **integration key** itself and its **RSA key pair**. Copy your **RSA key pair** into a file in your config folder `config/docusign_private_key.txt`. You must also add your application's **Redirect URI** to your integration key. To run the app locally, this should be `http://localhost:3000/auth/docusign/callback`. This [**video**](https://www.youtube.com/watch?v=GgDqa7-L0yo) demonstrates how to create an integration key (client ID) for a user application like this example.
2424
* [Ruby 3.1.2](https://www.ruby-lang.org/en/downloads/)
2525
* [Node.js](https://nodejs.org/) v16+
@@ -47,7 +47,7 @@ cd sample-app-myconnectwebhook-ruby
4747
```
4848

4949
### Create appsettings.yml file
50-
Copy `appsettings.example.yml` and fill it in with your settings taken from DocuSign Developer Account.
50+
Copy `appsettings.example.yml` and fill it in with your settings taken from Docusign Developer Account.
5151
```
5252
cp config/appsettings.example.yml config/appsettings.yml
5353
```
@@ -70,7 +70,7 @@ ngrok http 3000
7070
config.hosts << "xxx-xx-xxx-xxx-xx.ngrok.io"
7171
```
7272

73-
### Setup your custom DocuSign Connect configuration
73+
### Setup your custom Docusign Connect configuration
7474

7575
#### Using a ruby script
7676
The ruby script included with this project sets up a custom Connect configuration with the same settings that the hosted app uses at https://myconnectwebhook.sampleapps.docusign.com. You'll need to provide a name for your new custom connect configuration as well as the URL to publish which, if running locally using ngrok, should follow the format `https://{YOUR_NGROK_HOST}.ngrok.io/api/docusign/trigger/do_process.json`.
@@ -86,7 +86,7 @@ The ruby script included with this project sets up a custom Connect configuratio
8686
* Provide the name and URL to publish for your connect configuration when prompted.
8787
* Check https://admindemo.docusign.com/connect to view or edit your new custom Connect configuration!
8888

89-
#### Using the DocuSign UI
89+
#### Using the Docusign UI
9090
* Visit https://admindemo.docusign.com/authenticate?goTo=connect
9191
* Select "ADD CONFIGURATION" --> "Custom"
9292
* Add a name for your custom Connect configuration
@@ -107,7 +107,7 @@ The ruby script included with this project sets up a custom Connect configuratio
107107
Custom Fields
108108
Recipients
109109

110-
DocuSign Click:
110+
Docusign Click:
111111

112112
Click Agreed
113113
Click Declined

app/controllers/session_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def create
77
redirect_url = session[:return_to] || root_path
88
internal_destroy
99

10-
Rails.logger.debug { "\n==> DocuSign callback Authentication response:\n#{auth_hash.to_yaml}\n" }
10+
Rails.logger.debug { "\n==> Docusign callback Authentication response:\n#{auth_hash.to_yaml}\n" }
1111
str = "==> Login: New token for admin user which will expire at: #{Time.zone.at(auth_hash.credentials['expires_at'])}"
1212
Rails.logger.info(str)
1313
store_auth_hash_from_docusign_callback

app/services/jwt_auth/jwt_creator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class JwtCreator
99

1010
attr_reader :session, :api_client, :state
1111

12-
# DocuSign authorization URI to obtain individual consent
12+
# Docusign authorization URI to obtain individual consent
1313
# https://developers.docusign.com/platform/auth/jwt/jwt-get-token
1414
# https://developers.docusign.com/platform/auth/consent/obtaining-individual-consent/
1515
def self.consent_url(state, _)
@@ -83,7 +83,7 @@ def check_jwt_token
8383

8484
# docusign_esign: GET /oauth/userinfo
8585
# This endpoint returns information on the caller, including their name, email, account, and organizational information.
86-
# The response includes the base_uri needed to interact with the DocuSign APIs.
86+
# The response includes the base_uri needed to interact with the Docusign APIs.
8787
# https://developers.docusign.com/platform/auth/reference/user-info
8888
# rubocop:disable Metrics/AbcSize
8989
def update_account_info(token)

app/views/layouts/application.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>"MyConnectWebhook DocuSign Sample Application"</title>
4+
<title>"MyConnectWebhook Docusign Sample Application"</title>
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<meta property="og:title" content="MyConnectWebhook DocuSign Sample Application" />
7-
<meta property="og:description" content="Discover how the DocuSign Connect webhook service can help you monitor and automate your business processes through real-time updates when specific events are triggered in your workflows." />
6+
<meta property="og:title" content="MyConnectWebhook Docusign Sample Application" />
7+
<meta property="og:description" content="Discover how the Docusign Connect webhook service can help you monitor and automate your business processes through real-time updates when specific events are triggered in your workflows." />
88
<meta property="og:image" content="/images/MyConnectWebhook_OG.png" />
99

1010
<div class=" "></div>

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Application < Rails::Application
3434

3535
config.app_url = "http://localhost:3000" # The public url of the application.
3636

37-
# Init DocuSign configuration, loaded from config/appsettings.yml file
37+
# Init Docusign configuration, loaded from config/appsettings.yml file
3838
DOCUSIGN_CONFIG = YAML.load_file(Rails.root.join("config/appsettings.yml"))[Rails.env]
3939
DOCUSIGN_CONFIG.map do |k, v|
4040
config.send("#{k}=", v)

config/appsettings.example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ default: &default
1616
aud: account-d.docusign.com
1717
allow_silent_authentication: true # A user can be silently authenticated if they have an
1818
# Active login session on another tab of the same browser
19-
# Set if you want a specific DocuSign AccountId, If false, the users default account will be used.
19+
# Set if you want a specific Docusign AccountId, If false, the users default account will be used.
2020
target_account_id: false
2121

2222
development:

lib/docusign.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class Docusign < OmniAuth::Strategies::OAuth2
1111
option :name, "docusign"
1212

1313
# These are called after the OAuth2 login authentication
14-
# has succeeded and are part of the DocuSign callback response message:
15-
# transforms the DocuSign login response from the raw_info
14+
# has succeeded and are part of the Docusign callback response message:
15+
# transforms the Docusign login response from the raw_info
1616
# https://github.com/omniauth/omniauth/wiki/Strategy-Contribution-Guide#defining-the-callback-phase
1717
# into the standardized schema required by OmniAuth https://github.com/omniauth/omniauth/wiki/Auth-Hash-Schema
1818
# and gets exposed through the "request.env[omniauth.auth]" to the SessionController#create

public/favicon.ico

-32.1 KB
Binary file not shown.

public/locales/en/AutomatedWorkflow.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Title": "Automate workflow based on an elastic signing agreement",
3-
"SubTitle": "<p>Demonstrates how to use the DocuSign Connect webhook service to automate business processes based on a sample purchase license elastic template. Once the user takes action on the elastic template, the app will wait for a Connect notification before sending a sample purchase confirmation to the user’s provided email.</p> Please provide your name and email address to get started.</p>",
3+
"SubTitle": "<p>Demonstrates how to use the Docusign Connect webhook service to automate business processes based on a sample purchase license elastic template. Once the user takes action on the elastic template, the app will wait for a Connect notification before sending a sample purchase confirmation to the user’s provided email.</p> Please provide your name and email address to get started.</p>",
44
"SubmitButton": "Submit",
55
"AddRecipientButton": "Add recipient",
66
"Recipient": {
@@ -9,7 +9,7 @@
99
},
1010
"ApiDecription": {
1111
"SeeMore": "Behind the scenes",
12-
"CodeFlow": "<h3>This sample features:</h3><ul><li>Create and activate an elastic template</li><li>Embed an elastic template on your site</li><li>DocuSign Connect webhook service</li><li>Remote signing</li></ul><h3>Code flow:</h3><p>View source file <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-myconnectwebhook-ruby/blob/main/app/services/clickwraps/clickwrap_service.rb'>clickwrap_service.rb</a> on GitHub.</p><h5>Step 1</h5><p>Once recipient information is submitted by the user, the Click API is used to create a new elastic template if it doesn’t already exist in the account. To create an elastic template, we must provide a document for the user to read and agree to, a name for the elastic template, and we must define <code>display_settings</code> to control what the UI experience will look like. The elastic template is created using <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/click-api/reference/accounts/clickwraps/createclickwrap/'>ClickWraps:createClickwrap</a>. Then we must activate the elastic template before use with <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/click-api/reference/accounts/clickwraps/updateclickwrapversion/'>ClickWraps:updateClickwrapVersion</a> by updating the elastic template and setting the status to <code>active</code>.</p><h5>Step 2</h5><p>Using the ID of the elastic template created in the previous step, we display the elastic template using a JavaScript API call to the <code>docuSignClick.Clickwrap.render()</code> method. Required arguments include <code>clickwrap_environment</code>, which is <code>https://demo.docusign.net</code> for the development environment; <code>clickwrap_account_id</code>, which is the account ID for the preconfigured DocuSign developer account; <code>clickwrap_id</code>, which we obtain in the previous step; and <code>client_user_id</code>, which is created in the app session. To make this client-side API call, the code needs to include https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js on the page as a script element.</p><h5>Step 3</h5><p>View source file <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-myconnectwebhook-ruby/blob/main/app/controllers/api/docusign/trigger_controller.rb#L35'>trigger_controller.rb</a> on GitHub.</p><p>Once the user accepts or declines the elastic signing agreement, we wait for a DocuSign Connect notification to tell us what action was taken. If we receive a <code>click-agreed</code> notification, we can start the next step of the example workflow, otherwise the workflow ends at this step. The screenshot below shows the events to which we subscribe in our custom Connect configuration in the preconfigured account.</p> <p><img width='600px' src='/images/click_connect_config.png' alt='click connect configuration' /></p><h5>Step 4</h5><p>View source code <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-myconnectwebhook-ruby/blob/main/app/services/e_sign/send_envelope_service.rb'>send_envelope_service.rb</a> on GitHub.</p> <p>After receiving the <code>click-agreed</code> notification, we use the DocuSign eSignature REST API to create an envelope with <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/'>Envelopes:create</a>. In the envelope definition, we include a recipient with the information submitted by the user, a sample purchase confirmation document, and tabs. We set the envelope definition status to <code>sent</code> so that the envelope is sent immediately when we make our API call.</p>"
12+
"CodeFlow": "<h3>This sample features:</h3><ul><li>Create and activate an elastic template</li><li>Embed an elastic template on your site</li><li>Docusign Connect webhook service</li><li>Remote signing</li></ul><h3>Code flow:</h3><p>View source file <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-myconnectwebhook-ruby/blob/main/app/services/clickwraps/clickwrap_service.rb'>clickwrap_service.rb</a> on GitHub.</p><h5>Step 1</h5><p>Once recipient information is submitted by the user, the Click API is used to create a new elastic template if it doesn’t already exist in the account. To create an elastic template, we must provide a document for the user to read and agree to, a name for the elastic template, and we must define <code>display_settings</code> to control what the UI experience will look like. The elastic template is created using <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/click-api/reference/accounts/clickwraps/createclickwrap/'>ClickWraps:createClickwrap</a>. Then we must activate the elastic template before use with <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/click-api/reference/accounts/clickwraps/updateclickwrapversion/'>ClickWraps:updateClickwrapVersion</a> by updating the elastic template and setting the status to <code>active</code>.</p><h5>Step 2</h5><p>Using the ID of the elastic template created in the previous step, we display the elastic template using a JavaScript API call to the <code>docuSignClick.Clickwrap.render()</code> method. Required arguments include <code>clickwrap_environment</code>, which is <code>https://demo.docusign.net</code> for the development environment; <code>clickwrap_account_id</code>, which is the account ID for the preconfigured Docusign developer account; <code>clickwrap_id</code>, which we obtain in the previous step; and <code>client_user_id</code>, which is created in the app session. To make this client-side API call, the code needs to include https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js on the page as a script element.</p><h5>Step 3</h5><p>View source file <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-myconnectwebhook-ruby/blob/main/app/controllers/api/docusign/trigger_controller.rb#L35'>trigger_controller.rb</a> on GitHub.</p><p>Once the user accepts or declines the elastic signing agreement, we wait for a Docusign Connect notification to tell us what action was taken. If we receive a <code>click-agreed</code> notification, we can start the next step of the example workflow, otherwise the workflow ends at this step. The screenshot below shows the events to which we subscribe in our custom Connect configuration in the preconfigured account.</p> <p><img width='600px' src='/images/click_connect_config.png' alt='click connect configuration' /></p><h5>Step 4</h5><p>View source code <a target='_blank' rel='noopener noreferrer' href='https://github.com/docusign/sample-app-myconnectwebhook-ruby/blob/main/app/services/e_sign/send_envelope_service.rb'>send_envelope_service.rb</a> on GitHub.</p> <p>After receiving the <code>click-agreed</code> notification, we use the Docusign eSignature REST API to create an envelope with <a target='_blank' rel='noopener noreferrer' href='https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/'>Envelopes:create</a>. In the envelope definition, we include a recipient with the information submitted by the user, a sample purchase confirmation document, and tabs. We set the envelope definition status to <code>sent</code> so that the envelope is sent immediately when we make our API call.</p>"
1313
},
1414
"Error": {
1515
"FullNameIsRequired": "Full name is required",

0 commit comments

Comments
 (0)