Have you ever wondering on how to create a link on blogspot that can trigger a send message on whatsapp?
yep. basically. that is the code.
change your number in the code above. but remain the 6
This is the main API access provided by whatsapp.
This is the phone number used for making call to the phonebook. Important to put the country code. Malaysia use 6 in front.
This is the message that will appear in the whatsapp message input
SETUP BLANK PAGE IN BLOGGER
Now. in blogger. create a new blank page. (i have created test-whatsapp page)
now. we will want to edit this page using code editor. which is HTML editor. see the tabs on top left screen.
now. we paste the code <script></script> inside the editor
then, save/update the page.
you can try to view the page after you had saved it. it will surely go to the correct whatsapp app. if you are in mobile. It will open the whatsapp mobile app, if you are in PC, it will open up whatsapp web.
use the page link anywhere you would want it. in your blog post, in your facebook post. you name it.
whenever people are clicking on that link. they will be redirected to the correct whatsapp phone number and message too!
here is an example of my old blogspot that i used to make this tutorial:
WHAT IF ITS A LONG TEXT?
yeah. probably you will have a long initial text for your customer to initiate a pretty text. For this to work, you will need a converter. You cant pass an empty space to the whatsapp API. you will have to convert your test into “URL-ENCODED” type. like this:
so, your full coding should look like this:
window.location = "https://api.whatsapp.com/send/?phone=60123456789&text=hai!%0Anak%20tanye%20boleh%3F";
it will output text:
nak tanye boleh?
How to convert the text?
use this online text encoder:
type any text you want, then press encode!
use it on the