Concepts or coding lessons of Salesforce that you can implement easily

WhatsApp on Salesforce Integration in 5 Steps

WhatsApp's Click to Chat feature allows you to begin a chat with someone without having their phone number saved in your phone's address book. 
As long as you know this person’s phone number, you can create a link that will allow you to start a chat with them. 
By clicking the button, a chat with the person automatically opens. 
Click to WhatsApp Chat works on both your phone and WhatsApp Web.

1. Go to Setup -> Contacts -> Button and links
2. Click on New Button and Links button
3. Enter below required details:
Label: Click to WhatsApp Chat
Name: Click_to_WhatsApp_Chat
Display Type: Detail Page Button
Behavior: Display in New Window
Content Source: URL 



4. Use below URL in the text area:

https://api.whatsapp.com/send?phone={!Contact.Phone}&text={!JSENCODE("Hi "& Contact.Name &", Hope you are doing good. I want to connect with you regarding our new product.")}

5. Add this new button to the contacts page layout.

Now go to any contact which has correct phone number populated and click on Click to WhatsApp Chat button.

Note:
Use https://api.whatsapp.com/send?phone=whatsappphonenumber/&text=urlencodedtext where whatsappphonenumber is a full phone number in international format and URL-encodedtext is the URL-encoded pre-filled message.
Remove any zeroes, brackets or dashes when adding the phone number in international format. For a detailed explanation on international numbers, read this article.

You can use this functionality to any Salesforce standard and custom objects.


loading...

22 comments:

  1. You have written a very effective blog for readers, thank you so much to share this useful information. If you want best Trucking Insurance in US then you should visit our website.
    Great post friend, Thank a lot to share this. You are doing good job. Keep posting.
    Salesforce Consulting India

    ReplyDelete
  2. I just want to say that all the information you have given here is awesome...great and nice blog thanks sharing..Thank you very much for this one.
    And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things.
    Whatsapp Salesforce Integration

    ReplyDelete
  3. Thanks a lot for sharing that useful information. That was a really Intresting post and I would really like to know more.

    salesforce development company
    Salesforce development services
    Salesforce Consultant

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Can we use this code on any object like on Account, opportunity and also on custom objects.

    ReplyDelete
    Replies
    1. As long as you have Customer Name and Phone number field on any object(standard, custom), you can use this feature.

      Delete
  6. Nice Post....Thank you for sharing great information...Keep going on..
    Salesforce Training in Hyderabad

    ReplyDelete
  7. The best possible use makes the procedure or use justified, despite all the trouble. logo design service

    ReplyDelete
  8. You can try ValueText App which save lots of your time - https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000EFoedUAD

    ReplyDelete
  9. Is there a way to add this to open up the app instead of the Webpage?

    ReplyDelete
    Replies
    1. You can create visualforce page and embed whatsapp URL in

      Delete
  10. Wonderful blog post, thank you so much for the great information which you provided.
    Top 5 features of salesforce lightning

    ReplyDelete
  11. Is there a way to do this and have salesforce log each time you chat someone?

    ReplyDelete
    Replies
    1. In the content source, user onclick javascript option and once button clicked then call one of your apex class which have salesforce log logic and after that call WhatsAPP URL.

      Delete
  12. Just do it in one step with many options like automation, bulk and single texting, powerful bots and many more https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000EFoedUAD

    ReplyDelete
  13. Where will reply from customer stores in salesforce

    ReplyDelete
  14. Hi, I used this tutorial some months ago. It worked weel so far; But recently it seems web.whatsapp change, and now the button open the page, but not launching the new chat, instead it push to install app.

    ReplyDelete
  15. Hi,

    link given in the above tutorial might not work now on ... i tried it today and was giving me .. page not found error...

    try below endpoint url format.. it should work fine. worked well for me.


    https://api.whatsapp.com/send?phone={!Contact.Phone}&text={!JSENCODE("Hi "& Contact.Name &", Hope you are doing good.You are receiving this message because you have been referenced as contact in salesforce ,")}

    ReplyDelete
    Replies
    1. Thank you Sumit for above details. I have updated my Blog. :
      Happy Coding.

      Delete
  16. Hi, great post! In my case i want to create cases with WA chat information. i guess i need to develop an API if i dont have WA business. regards

    ReplyDelete
  17. Nice one indeed!
    I was wondering, what about if your phone field was not properly populated? I mean, there are spaces and + and - characters. What would you suggest to properly format them all?

    ReplyDelete