Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mandaputtra
Created September 29, 2018 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mandaputtra/076a618a1519407afc889d531bc136c8 to your computer and use it in GitHub Desktop.
Save mandaputtra/076a618a1519407afc889d531bc136c8 to your computer and use it in GitHub Desktop.
Click to send whastapp
// https://api.whatsapp.com/send?phone=+{{ *YOURNUMBER* }}&text=%20{{ *YOUR MESSAGE* }}
var yourNumber = "{{ your number in string}}"
var yourMessage = "{{ your message in string }}"
// %20 mean space in link
// If you already had an array then you just join them with '%20'
// easy right
function getLinkWhastapp(number, message) {
number = this.yourNumber
message = this.yourMessage.split(' ').join('%20')
return console.log('https://api.whatsapp.com/send?phone=' + number + '&text=%20' + message)
}
getLinkWhastapp()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment