1

I have a website having whatsapp link on it. When click on WhatsApp icon WhatsApp app opens with chatbox. I want an auto written msg on it so that the user only has to press the send button. Plz, help. Thanks in advance.

HTML :

    <a class="english call-msg"  
       href= "https://wa.me/+911234567891" data-action="share/whatsapp/share"
      target="_blank">
     <i class="fa fa-whatsapp"></i>Whatsapp
   </a>
Sarun UK
  • 6,210
  • 7
  • 23
  • 48
Ms Designer
  • 263
  • 1
  • 2
  • 11
  • I don’t know if you can with the short url, but try adding the query string parameter “text=your%20message%20here”? – evolutionxbox Oct 09 '20 at 09:41
  • Does this answer your question? [Web link to specific whatsapp contact](https://stackoverflow.com/questions/30344476/web-link-to-specific-whatsapp-contact) – swift-lynx Oct 09 '20 at 09:47

2 Answers2

4

To create a link with just a pre-filled message, use https://wa.me/{number}?text=urlencodedtext

<a href="https://wa.me/911234567891?text=hello%20world">Whatsapp</a>

Ref: https://faq.whatsapp.com/iphone/how-to-link-to-whatsapp-from-a-different-app/?lang=fb

Asif Ali
  • 68
  • 1
  • 6
1

You can provide an additional text parameter:

<a href="https://wa.me/911234567891?text=hello%20world">Whatsapp</a>

or

<a href="https://api.whatsapp.com/send?phone=911234567891&text=hello%20world">Whatsapp</a>

or

<a href="whatsapp://send?phone=911234567891&text=hello%20world">Whatsapp</a>

https://stackoverflow.com/a/43357241/10551293

https://faq.whatsapp.com/general/chats/how-to-use-click-to-chat/

Ms Designer
  • 263
  • 1
  • 2
  • 11
swift-lynx
  • 3,219
  • 3
  • 26
  • 45