In today’s digital world, customers prefer instant communication, and WhatsApp has become one of the most popular messaging platforms globally.
Businesses use WhatsApp for sales, support, and marketing because it enables fast, direct communication with customers.
According to industry data, WhatsApp is used by billions of users across more than 180 countries, making it a powerful channel for customer engagement.
On the other hand, Salesforce is a leading CRM platform that stores customer data, including Leads, Contacts, Opportunities, and Cases.
However, many organizations face a common problem: customer conversations happen on WhatsApp, but the data is not stored in Salesforce. This creates a gap between communication and CRM data.
To solve this problem, businesses integrate WhatsApp with Salesforce Contacts. This integration helps sales and support teams communicate with customers directly from Salesforce while maintaining a complete record of interactions.
In this article, I will explain how to integrate WhatsApp with Salesforce contacts. To enable this WhatsApp chat for any other object, such as Leads, you can follow the same steps.
What is WhatsApp Integration with Salesforce?
WhatsApp integration with Salesforce means connecting the WhatsApp Business platform with Salesforce CRM so that users can send and receive messages directly from Salesforce.
This integration allows businesses to manage customer communication, automate responses, and track conversations in one place. To integrate WhatsApp with Salesforce Contacts, we will cover the following points.
- Create a Custom WhatsApp Chat Button in Salesforce
- Adding the Button to Contact Page Layouts
- Test the WhatsApp Integration
Why Integrate WhatsApp with Salesforce Contacts?
Businesses integrate WhatsApp with Salesforce for multiple reasons:
- Centralized Communication: All messages are stored in Salesforce, so teams don’t need to switch between apps.
- Better Customer Experience: Quick responses improve customer satisfaction.
- Improved Sales Process: Sales reps can directly contact leads from Contact records.
- Automation Capabilities: Businesses can automate messages using flows or APIs.
- Complete Customer History: Every conversation is linked to the Contact record, providing full context.
Different Ways to Integrate WhatsApp with Salesforce
There are multiple ways to integrate WhatsApp with Salesforce. Choosing the right method depends on your business requirements and budget.
1. Using Custom Button (Basic Method)
This is the simplest method: create a custom button in Salesforce that opens a WhatsApp chat via a URL.
Example:
https://api.whatsapp.com/send?phone={!Contact.Phone}When the user clicks the button:
- It opens WhatsApp
- Starts chat with the Contact’s phone number
This method is easy to implement and does not require API integration.
2. Using WhatsApp Business API (Advanced Method)
This is the most powerful method used by enterprises.
- Requires WhatsApp Business API
- Enables sending and receiving messages
- Supports automation and templates
This method provides full integration, with messages stored in Salesforce and linked to CRM records.
3. Using Third-Party Tools
Some popular tools include:
- Twilio
- WATI
- 360dialog
- SMS Magic
These tools act as a bridge between WhatsApp and Salesforce.
Example: Twilio API can be used to send WhatsApp messages via Apex code.
4. Salesforce Native Integration (Digital Engagement)
Salesforce provides native integration through Service Cloud.
Features:
- Messaging console
- Chat routing
- Omni-channel support
- Automated replies
This is best for customer support teams.
Basic WhatsApp Integration with Salesforce Using a Custom Button
Let’s understand the easiest way step by step.
Create a Custom WhatsApp Chat Button in Salesforce
In the steps below, we will create a custom button action that redirects to WhatsApp via the WhatsApp API.
- In this example, we will create a custom button for the Contact object. For that, navigate to the Object Manager tab and click Contacts.
- In the Contacts setup, click on Buttons, Links, and Actions. In the next window, click on New Button or Link.

- Now, we will define the action button that redirects to WhatsApp and opens the chat for the Contact record’s phone number. Enter the following details to define the custom button.
- Enter the Label and Name for the custom button.
- In the Display Type, select the option Detail Page Button.
- Select “Display in new window” for the Behavior.
- In the Content Source, select the URL option.

- To configure the action button with WhatsApp, navigate to the formula editor and enter the WhatsApp API link.
https://api.whatsapp.com/send?phone={}
- To get the contact phone number, we use the merge fields. After the WhatsApp API link, enter the merge field “Contact.Phone“.
send?phone={!Contact.Phone}
- We can also add a default text here; for that, add a & parameter and enter the text. To encode text and merge field values, we will use the JSENCODE function.
Inside the JSENCODE, enter the default text. In this, I have added a merge field Contact.Name to dynamically fetch the contact’s name.
text={!JSENCODE("Hi" & Contact.Name & ",how are you?")}
The final code in the custom button editor will be:
https://api.whatsapp.com/send?phone={!Contact.Phone}&text={!JSENCODE("Hi" & Contact.Name & ",how are you?")}- At last, check the syntax and click Save.
With this, we have defined the custom chat button that opens the contact’s phone number in the WhatsApp chat.
Add the Chat Button to the Contact Page Layout
To make the button visible on the Contact record page, we will add it to the contact page layout.
- Navigate to Setup > Object Manager > Contacts > Page layouts. In the page layouts, select the default page layout.

- In the Contact layout setup, click on Mobile and Lightning Actions. Select the WhatsApp chat button action and drag it to the Salesforce Mobile and Lightning Experience Actions section.

After this, click Save to apply the changes to the page layout.
Test the WhatsApp Integration
To test the WhatsApp integration with Salesforce contacts, navigate to the Contacts tab and open a Contact record whose Phone field is not null or blank.
On the Contact record page, click on the action button “WhatsApp Chat.”

As we click on the action button, it will redirect to WhatsApp and open the chatbox with the default message.

If the phone number entered in the Contact record is not registered with WhatsApp or is invalid, it will display the text “The phone number isn’t on WhatsApp.”

This way, we can integrate the WhatsApp chat with the Salesforce objects that have the Phone field.
Comparison of Integration Methods
| Method | Complexity | Cost | Features |
|---|---|---|---|
| Custom Button | Low | Free | Basic chat |
| API Integration | High | Paid | Full automation |
| Third-Party Tools | Medium | Paid | Advanced features |
| Native Salesforce | High | Paid | Enterprise solution |
Frequently Asked Questions
Q1: Can we send WhatsApp messages directly from Salesforce?
Yes, using API or third-party tools
Q2: Is WhatsApp integration free?
Basic method is free, API is paid
Q3: Can messages be stored in Salesforce?
Yes, with proper integration
Q4: Is coding required?
Not for the basic method, required for the advanced
Conclusion
Integrating WhatsApp with Salesforce Contacts is a powerful way to improve customer communication and business efficiency. It allows organizations to connect with customers instantly while maintaining complete records in the CRM system. Businesses can choose from simple methods, such as custom buttons, or advanced API integrations, depending on their requirements.
With the growing importance of real-time communication, WhatsApp integration is no longer optional but essential for modern businesses. By implementing this integration correctly, companies can improve customer experience, increase sales, and streamline their processes.
To integrate WhatsApp with any other object in the phone field, you can follow the same steps.
You may also like to read:
- Embed Lightning Web Component In Visualforce Page
- Display PDF Files With Lightning Web Component in Salesforce
- Send SMS From Salesforce Using Twilio
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.