This section details the requirements for a successful initial provisioning and installation of the blueprint application, including the necessary prerequisite steps, the variables that are needed to initiate installation, and the installation steps themselves.
- Prerequsites
- Retrieve Latest Blueprint from Github
- Provision Frontline Twilio Account
- Deploy Frontline Serverless
- Provision Salesforce Account
- Configure Frontline SSO to Salesforce
- Add User to Salesforce Account
- Add Custom Fields to Contact Layout
The following prerequisites must be satisfied prior to installing the application.
Install Docker desktop that includes docker compose CLI will be used to run the application installer locally on your machine. Goto Docker Desktop and install with default options. After installation make sure to start Docker desktop.
- Download and install from https://developer.salesforce.com/tools/sfdxcli.
- To verify installation, go to a terminal and run
If a version number is printed, you have installed the CLI correctly like below
sfdx --version
sfdx-cli/7.151.1 darwin-x64 node-v16.13.1
-
If this is your first time installing this blueprint, open a terminal and execute the following:
git clone https://github.com/twilio/hls-frontline-pharma.git
-
Otherwise, open a terminal and
cd
to thehls-frontline-pharma
folder and execute the following:git pull
A separate Twilio account is required for Frontline. Note that Flex service CANNOT be enabled on this Twilio account.
-
Account creation page at https://www.twilio.com/console/projects/create
- Set account name to
hls-frontline-pharma
& click 'Verify' button - Verify the new Twilio account either via email or phone
- Once the Twilio account is created,
please note the
Account SID
andAuth Token
from the Twilio console for later use. - If you have multiple Twilio Projects under your account, make sure that you are logged into the Project that you want the application to be deployed to.
- Set account name to
-
If you don't already have a Twilio account, goto Free trial page at https://www.twilio.com/try-twilio
If you have multiple Twilio Projects under your account, make sure that you are logged into the Project that you want the application to be deployed to.
- Open Admin Center at https://www.twilio.com/console/admin
- If opening errors, then look for
'Create an Organization'
menu item from the console account selection menu - Click
'Create an Organization'
- Create an organization, you can name it anything (e.g., OwlHealth)
- Sample Organization page below
- Open Active numbers page at https://www.twilio.com/console/phone-numbers/incoming
- Click
- Find a phone number that has SMS & Voice capabilties
- Click on the right of the phone number
If you intend to send outbound SMS from this Twilio account, please get the account upgraded to an employee acount.
- Open Frontline Overview page at https://www.twilio.com/console/frontline
- Click
- After your Frontline service is created, you'll see 4 list items under
'Configure the Frontline application'
where the first step should be completed (striked-out) for you already.
-
Open Conversations Defaults page at https://www.twilio.com/console/conversations/configuration/defaults
-
Click of
Default Messaging Service
to open Messaging Integration page -
Select
Autocreate a Conversation
radio button -
Select
Sender Pool
in the left pane -
Keep Sender Type as
'Phone Number'
-
Select checkbox next to your Twilio phone number bought above. (lookup at https://www.twilio.com/console/phone-numbers/incoming)
- Open Frontline Configure SSO page at https://www.twilio.com/console/frontline/sso
- Note Realm SID (e.g.,
JBccd16179731fe20736f887e6eXXXXXXX
)
and save by executingsource ./configuration.sh FRONTLINE_REALM_SID
Frontline Twilio & Salesforce accounts must be already provisioned.
Please ensure that you do not have any running processes
that is listening on port 3000
such as development servers or another HLS installer still running.
Make sure to increase the docker desktop memory from default 2GB to 6GB.
First, to ensure installation using the latest docker image, execute the following in your terminal window
docker image rm twiliohls/hls-frontline-pharma-installer
Replace ${TWILIO_ACCOUNT_SID}
and ${TWILIO_AUTH_TOKEN}
with that of your target Twilio account.
docker run --pull=always --name hls-frontline-pharma-installer --rm --publish 3000:3000 \
--env ACCOUNT_SID=${TWILIO_ACCOUNT_SID} --env AUTH_TOKEN=${TWILIO_AUTH_TOKEN} \
--interactive --tty twiliohls/hls-frontline-pharma-installer
If running on Apple Silicon (M1 chip), add --platform linux/amd64
option.
-
Enter the following information:
Field Value Administrator Your mobile phone number for receiving MFA in E.164 format Application Password password for applciation administrator page access
(recommend just usingpassword
)Sf Consumer Key SALESFORCE_API_KEY Sf Username SALESFORCE_USERNAME Sf Instance Url SALESFORCE_URL
(e.g., https://twilio-b3-dev-ed.my.salesforce.com) -
When '✔ Application is deployed', deployment is complete
In the installer, click the Administration button towards the bottom of the page to open up the Administration page. When the page opens, click the "Seed Data" button, and wait until the adjacent text says "SUCCESS". Refresh the page to see the data seeded into Salesforce.
To terminate installer:
- Enter Control-C in the terminal where
docker run ...
was executed; or - Stop the
hls-frontline-pharma-installer
docker container via the Docker Desktop
Frontline requires that there is a SSO integrated with your App in order to sign in to the Frontline app. For that we'll need a Salesforce Developer Account.
-
Open sign up page at https://developer.salesforce.com/signup
-
Enter the following information:
Field Value First Name your-first-name
Last Name your-last-name
Email your-twilio-email +1
(e.g.,bochoi+sf@twilio.com
to identify email used per sign-up)Role Developer Company Twilio Country/Region United States Postal Code 94105 Username login-name-to-use
(e.g.,bj@owlhealth.com
.
Note that username can be different from email and used to log into frontline app) -
Wait until you see
'Please check your email to confirm your account'
-
Wait until you receive email with subject
'Welcome to Salesforce: Verify your account'
-
Open the email and note the following:
- Salesforce URL (e.g., https://twilio-b3-dev-ed.my.salesforce.com)
and save by executingsource ./configuration.sh SALESFORCE_URL
- Username above entered during sign-up
and save by executingsource ./configuration.sh SALESFORCE_USERNAME
- Salesforce URL (e.g., https://twilio-b3-dev-ed.my.salesforce.com)
-
In
Change Your Password
page, enter your password and remember it as you'll need it to login on the frontline app -
You will be logged into your Salesforce account
- From
Setup Home
, navigate toSETTINGS ⮕ Security ⮕ Certificate and Key Management
-
Enter the following information:
Field Value Label SalesforceIDP Unique Name SalesforceIDP Exportable Private Key ✔ Key Size 2048 Company Twilio Country/Region United States Postal Code 94105 -
Click that will download
SalesforceIDP.crt
file to~/Downloads
folder for later use -
Sample screen below
- From
Setup Home
, navigate toSETTINGS ⮕ Identity ⮕ Identity Provider
-
Select certificate
SalesforceIDP
-
Sample screen below
- From
Setup Home
, navigate toPLATFORM TOOLS ⮕ Apps ⮕ App Manager
-
In
Basic Information
section, fill in the following:Field Value Connected App Name FrontlinePharma API Name FrontlinePharma Contact Email email-used-to-sign-up
(e.g., bochoi+sf@twilio.com) -
In
API (Enable OAuth Settings)
section, enter the following:Field Value Enable OAuth Settings ✔ Callback URL https://login.salesforce.com/services/oauth2/success Use digital signatures ✔ and click and upload hls-frontline-pharma/assets/server.crt
Selected OAuth Scopes Add Manage user data via APIs (api)
&Perform requests at any time (refresh_token, offline_access)
to 'Selected OAuth Scopes' -
In
Web App Settings
section, enter the following replacing FRONTLINE_REALM_SID with your Realm SID
or generate by executingsource ./configuration.sh
:Field Value Enable SAML ✔ Entity Id https://iam.twilio.com/v2/saml2/metadata/FRONTLINE_REALM_SID ACS URL https://iam.twilio.com/v2/saml2/authenticate/FRONTLINE_REALM_SID IdP Certificate SalesforceIDP -
Sample screen below
- From
Setup Home
, navigate toPLATFORM TOOLS ⮕ Apps ⮕ Connected Apps ⮕ Manage Connected Apps
-
Select
FrontlinePharma
app -
Scroll down to
Profiles
section -
Scroll down to
Custom Attributes
section -
From
Setup Home
, navigate toPLATFORM TOOLS ⮕ Apps ⮕ Connected Apps ⮕ Manage Connected Apps
-
In
OAuth Policies
section,Field Value Permitted Users Change to Admin approved users are pre-authorized
IP Relaxation Change to Relax IP restrictions
- From
Setup Home
, navigate toPLATFORM TOOLS ⮕ Apps ⮕ App Manager
-
Locate
FrontlinePharma
app and click from the right drop down menu -
In
API (Enable OAuth Settings)
section:- Save Consumer Key by executing
source ./configuration.sh SALESFORCE_API_KEY
- Save Consumer Key by executing
-
Open a terminal and cd to your
hls-frontline-pharma
folder -
Execute the following script replacing SALESFORCE_API_KEY and SALESFORCE_USERNAME below with your values
or generate by executingsource ./configuration.sh
sfdx auth:jwt:grant \ --clientid SALESFORCE_API_KEY \ --jwtkeyfile assets/server.private.key \ --username SALESFORCE_USERNAME \ --setdefaultdevhubusername --setalias SALESFORCE_USERNAME
Follow the steps in Deploy Blueprint Service
-
Open Frontline Configure SSO page at https://www.twilio.com/console/frontline/sso
-
Enter the following, replacing SALESFORCE_URL or execute
source ./configuration.sh
:Field Value Workspace ID Subdomain of SALESFORCE_URL
(e.g., twilio-b3-dev-ed)Identiy provider issuer SALESFORCE_URL SSO URL SALESFORCE_URL/idp/endpoint/HttpRedirect X.509 Certificate paste the contents of executing cat ~/Download/SalesforceIDP.crt
-----BEGIN CERTIFICATE-----
MIIEcjCCA1qgAwIBAgIOAYD5aqycAAAAABDSggIwDQYJKoZIhvcNAQELBQAwfjEW
...-----END CERTIFICATE-----
-
Open Functions Services at https://www.twilio.com/console/functions/overview/services
-
Click service named
hls-frontline-pharma
-
Scroll to the bottom and note the hostname just above button (e.g., hls-frontline-pharma-6110-dev.twil.io)
and save by executingsource ./configuration.sh FRONTLINE_SERVICE_HOSTNAME
-
Open Frontline Manage Routing at https://www.twilio.com/console/frontline/routing
-
Click on
'Custom routing'
radio button -
Enter for 'Custom routing callback URL',
https://FRONTLINE_SERVICE_HOSTNAME/inbound-routing
-
Sample screen below
-
Open Frontline Manage Callbacks https://www.twilio.com/console/frontline/configure
-
Enter following by replacing FRONTLINE_SERVICE_HOSTNAME or executing
source ./configuration.sh
:Field Value CRM Callback URL https://FRONTLINE_SERVICE_HOSTNAME/crm Outgoing Conversations Callback URL https://FRONTLINE_SERVICE_HOSTNAME/outgoing-conversation Templates Callback URL https://FRONTLINE_SERVICE_HOSTNAME/templates
-
Open Conversations Webhooks https://www.twilio.com/console/conversations/configuration/webhooks
-
Enter following by replacing FRONTLINE_SERVICE_HOSTNAME or executing
source ./configuration.sh
:Field Value Pre-Event URL https://FRONTLINE_SERVICE_HOSTNAME/conversation Post-Event URL https://FRONTLINE_SERVICE_HOSTNAME/conversation Pre-webhooks Select onConversationAdd
onMessageAdd
onParticipantAdd
Post-webhooks Select onConversationAdded
,onConversationUpdated
,onConversationStateUpdated
onMessageAdded
onParticipantAdded
-
Open Frontline Manage Callbacks https://www.twilio.com/console/frontline/voice
-
Select
Enabled
radio button -
Open Active numbers page at https://www.twilio.com/console/phone-numbers/incoming
-
Select your Twilio phone number
-
Scroll down to
Voice & Fax
section
- Open Frontline at https://www.twilio.com/console/frontline
- If configuration was succesful, you should be
'Download the Twilio Frontline app'
section - Download the Frontline app
- Start the Frontline app on your mobile device
- Login using FRONTLINE_WORKSPACE_ID (Frontline Workspace ID) and SALESFORCE_USERNAME
- If logging in for the first time, email with subject 'Verify your identity in Salesforce' will be sent to your email used to sign up for Salesforce account above.
- By default, Contacts to not have a field called "Consent"; this must be manually added to be seen in the Contact Details.
- Click on Setup in the top right of Salesforce.
- On the left pane, click Objects and Fields > Object Manager.
- Click on Contact, then Page Layouts, then "Contact Layout".
- Drag "Consent" from the list of fields at the top of the page to the Contact Information section
- Hover over the Highlights Panel and a button with a wrench will appear on the right hand side; click this:
- Select "Consent" from the dropdown menu titled "Top Field"
- Hit OK.
- Select the save button on the top left of the fields pane.
Note It takes up to 10 minutes for the custom field attribute to become visible.
- Outbound routing is not working:
- Usually happens when a Salesforce Contact's phone number is not in E. 164 Format "+1234567890"
This is 100% optional if you want to add a 2nd user to your Salesforce account
You can add a user
to your (i.e., where you are the administrator) Salesforce account.
The Salesforce developer account allows adding 1 (total of 2) users.
Login using your username to the Salesforce Account to add user to.
The URL should end with my.salesforce.com
- From
Setup Home
, navigate toADMINISTRATION ⮕ Users ⮕ Users
-
In
New User
screen, enter the following:Field Value First Name First name of new user Last Name Last name of new user Alias Assign any alias for new user Email Assign email for new user, making sure not to re-use previous used email
Recommend using + email, e.g., bochoi+sf2@twilio.comUsername Login username in email format (e.g., bj@owlhealth.com
)
Make sure this is unique within the Salesforce account.Nickanme Same as Alias
aboveRole Select any role from dropdown User License Select Salesforce from dropdown Profile Select Standard User from dropdown
(call it NEW_SALESFORCE_USERNAME) -
Verify new user email via your email client & set a password
-
Open a terminal and cd to your
hls-frontline-pharma
folder -
Execute the following script replacing SALESFORCE_API_KEY and SALESFORCE_USERNAME below with just created username
sfdx auth:jwt:grant \ --clientid SALESFORCE_API_KEY \ --jwtkeyfile assets/server.private.key \ --username NEW_SALESFORCE_USERNAME \ --setdefaultdevhubusername --setalias NEW_SALESFORCE_USERNAME
TBD