In this guide, you’ll learn how to set up the MessageBird Salesforce Sales & Service Cloud application.
This guide will walk you through the entire process — if you need any help feel free to contact our Support team, we're here for you.
Prerequisites
- Create a MessageBird free account
- Have a Salesforce Enterprise (or higher) license with Lightning support
- Have access to the SMS and WhatsApp Business channels.
- Have administrative access to Salesforce — as Salesforce for MessageBird is not a Salesforce license
- MyDomain configured for Salesforce
- Install the application to your Salesforce Environment
How to get the app
- Go to the Salesforce AppExchange and look for MessageBird
- Choose Messagebird for Salesforce: Multichannel Conversations & Messaging.
- On the purchase page of the app, tap Get Now in the bottom-right of your screen to purchase the app from AppExchange and start the installation.
- A pop-up will open where you can choose whether you want to install the MessageBird package in the Sandbox or in the Production environment.
- Installation details should be prompted. Awesome! Click on Confirm and Install.
- Done? You’ll now be able to define access for this package, that is, in which Business Units the users in the SFSSC account are able to use this package. You can Install it for Admins Only, for All Users or for specific profiles.
- A pop-up will open regarding the approval of third-party access. Click Continue for the installation to start and then tap Done.
- And that’s it! You will see the MessageBird Package on your Installed Packages.
Now that the package has been installed, you need to complete the settings to connect your MessageBird account to your SFSSC account.
Configuring the MessageBird app
The custom setting Webhook Config has a Debug mode field. A default organization level value can be created with Debug mode true to create custom Debug logs for the webhook.
Permission Sets
There are two permission sets in the package which should be assigned to the respective users:
- Messagebird_Admin
- Messagebird_Standard_user
Before assigning users to the permission sets, please add the permission to read, create and edit Opt_Out custom object for both of them. To do this change, clone the permission set, edit them and add the users.
- The Messagebird Admin permission set can be used only by admins. It allows them to create Configuration metadata, Webhooks, HSM templates and look at the Debug logs (custom object).
- The Messagebird Standard user permission set can be used by standard users and allows them to create conversations and send messages.
MessageBird Application Settings
To connect Salesforce with MessageBird, you must set up their endpoint, access key, among others, on the package configuration. To do that, please follow these steps:
- Go to Setup
- Hit Installed packages
- Click Configure
If there are no force.com sites in the org, then you’ll see the following screen:
Note: A force.com presence is needed to exposing webhooks needed for conversation updates
To create the force.com site, please make sure that the site domain is already available and click Continue to Setup screen.
Enter your site name and tap Create site. This will create a custom force.com site and the permission set Webhook Assignment will assign the guest user of the site.
Account Settings
The Account Settings tab allows you as an admin to create configuration custom metadata records with the Access key and Signing Key of your MessageBird account.
Fill the Access Key and Signing Key fields accordingly. In the ReportURL field, enter the force.com site that you just created in the previous above.
As an admin, you can view the list of configuration records available by clicking on the arrow as the image below shows. You can perform the following actions:
- Update
- Show keys: displayed the Access and Signing keys in a human-readable format
- Hide Keys: obfuscates the Access and Signing keys
- Sync channels: synchronize channel information from MessageBird to the Salesforce plugin (required to do at least once, plus every time new channels are configured on the MessageBird side)
- Sync templates: synchronize WhatsApp templates from MessageBird to the Salesforce plugin (required every time new templates are added)
- Get WhatsApp Namespace: get the namespace for the WhatsApp channel from MessageBird (required to do at least once, plus every time we change the namespace information on the MessageBird side)
Webhook Settings
Create Webhook
The Webhook Settings tab allows you as an admin to create webhooks for each configuration record, simply select it from the drop-down menu. Enter the force.com site created above in the Webhook URL field. The Channels displayed in the drop-down menu will be those that are synced for each configuration. Done? Hit Create Webhook when you’re ready.
List of Webhook
A List of Webhooks is displayed in the Configurations drop-down menu.
If you wish to delete a webhook, click on the arrow next to the status of the webhook, and tap Delete.
Note: For a well functioning system, you will need to create a webhook for each available channel.
Advanced Configurations
The Advanced Configuration tab allows you as an admin to choose the Browser Synchronisation Method (platform events or query every x seconds) for the conversations/messages.
By default, we are using the Salesforce platform events mechanism to receive updates for messages and conversations but if you are reaching the limits of your events quota you can switch to using the query method for conversation updates. Read more about Salesforce events limits here.
Note: Using the events mechanism offers the best user experience (low latency of receiving messages).
Contact Phone Fields
The fields in the Selected column will be used to search to link the contact with the conversation. In the following example, the Business Phone is the field that will be used to link the contact to the conversations. You can add other fields such as Business Fax, Mobile Number, Home Phone, Other Phone, and Asst. Phone.
Don’t forget to tap Save when you’re finished setting your configuration.
Note about numbers
To match a contact with their respective number, we need their number to be in international format (country code included). Otherwise, the system might not be able to infer the corresponding country. Examples:
- For a US number: correct 14088001500, incorrect: 4088001500
- For a Singapore number correct 6567355020, incorrect: 67355020
Process builder
To send messages and message templates you will need to create the corresponding processes that convert salesforce send messages and send template actions (the Send action on the conversation) to MessageBird API calls, so 2 processes are needed.
Step 1:
Create a process builder for the Message__c object with the start process when a record is created or edited.
Step 2:
Add first criteria and set Message__Status__c to equal send now and Message_Type__c to equal text.
Step 3:
Add an immediate action, and set it as follows:
Action: Call Apex
Apex Class: Send Messages
Set the Apex Variables as the following:
- Configuration Name: Conversation__r.Configuration_Name__c
- Message Id: Id
- Channel Id: Message_Channel_Id__c
- To: Message_To__c
- Type: Message_Type__c
- Message image: Message_Image__c
- Message video: Message_Video__c
- Message file: Message_File__c
- Message text: Message_Text__c
- Message audio: Message_Audio__c
Step 4:
Add second criteria and set Message__Status__c to equal ‘send now’ and Message_Type__c to equal ‘hsm’.
Add an immediate action, and set it as follows:
- Action: Call Apex
- Apex Class: Send Messages
Add an immediate action, and set it as follows:
- Action: Call Spex
- Apex Class: Send Messages
The field Configuration QualifiedAPI name needs the string value of the qualified api name of the configuration custom metadata, for example, mbird__MessageBird. Set the other Apex Variables variables like the following:
- Message Id: Id
- Channel Id: Message_Channel_Id__c
- To: Message_To__c
- Type: Message_Type__c
- HSM Template: HSM_Template__r.Id
- Configuration Name: Conversation__r.Configuration_Name__c
Adding a Lightning component to the Conversation detail page
- Open any Conversation Record Detail Page
- Go to Settings
- Tap Edit page
- Scroll down until you find the Custom tab
- Select the Send Messages component and drag it to your page
Adding a Lightning component to the Contact detail page
- Open any Contact record detail page
- Go to Settings
- Tap Edit page
- Scroll down until you find the Custom tab
- Select the Contact Conversation View component and drag it to your page
Adding a Lightning component to the Account/Case detail page
- Open any Account/Case record detail page
- Go to Settings
- Tap Edit page
- Scroll down until you find the Custom tab
- Select the Conversation List component and drag it to your page.
Get All Conversations
To get all the conversations of your MessageBird account into salesforce, we run a batch process in the developer console. This would be a required operation the first time you are installing the plugin (to retroactively get existing conversations).
- Click on the gear icon on the top-right corner of your page
- Tap Developer console
- Copy-paste the code, it will look similar to the following:
Get All Messages in Conversations
To get all the messages in conversations of your MessageBird account into salesforce, we run a batch process in the developer console.
- Click on the gear icon on the top-right corner of your page
- Tap Developer console
- Before getting all the messages, run the batch to get all conversations—as we get messages for each conversation in this batch.
- Copy-paste the code, it will look similar to the following:
Out of Office Messages
To send out of office messages to your customers. Business hours should be set up in the org and relate it to the channels with a message.
- Go to Setup
- Search for Business Hours
- Configure your business hours
- Go to the Channels tab and select the Channel record for which you want the out of office message to be sent
- Enter the modified business hours record in the Business Hours field and enter your message in the Out of Office Message field.
HSM Templates Integration
To create HSM templates in salesforce and send them for approval.
- Go to the HSM Template Headers tab and create a new record, choose your category and language policy.
- Go to the related list, create new HSM Template records for the different languages with Language and Template content.
- Keep in mind that the accepted templates will be shown in the conversation component to send messages.
- Once you’ve created the HSM Template records, click on the Integrate quick action on the HSM Template Header page for approval.
- For each HSM Template, go to the related list and enter the Parameter Records to add them in the template message.
- The field Source Text is a constant text value and Source Field is the field name of the object.
- The Order field is the order in which the parameters in the template are replaced. For example, in the template is ‘Hi {{1}}’ with a related parameter, Source text ‘Teja’ and order ‘1’, the parameter record with order 1 will replace {{1}} in the template when the message is sent to the customer as ‘Hi Teja’.
Configuring business flows in Salesforce (optional)
These settings are not required, they are just suggestions on how could you create the required Salesforce flows to connect conversations with your agents. Feel free to discard these instructions and reuse your company’s existing processes.
Assigning conversations to queues
If your support system operates based on queues (not a must, but usually the case) then a process is needed to ensure that new conversations are assigned to the appropriate queue
Defining the queue
If you are using queues, you need to define who is part of the queue.
Salesforce Omnichannel widget configuration
To receive notifications in the salesforce Omnichannel Widget a couple of things are required.
Service channel definition
A new channel associated with a conversation must be enabled.
Presence definition
The agent must be in a status that allows him to receive notification (just as if he would be signing into the support queue, ready to receive messages).
Permission sets for presence
Depending on your RBAC (roles-based administration configuration) rules, you might need to specifically provide the user access to the new presence status - a new role that allows access to a particular presence.
Skill-based routing (advanced routing)
If your business requires advanced case routing options (skill-based routing), that is something Salesforce manages - you can access from the Omnichannel settings.
Learn more about skill-based routing in Salesforce.