Dynamic Tex Message Generator for Whatsapp

How to use:

  1. You have to capture and validate the data in your own function
  2. Remember link the js: src="wsppSendTextMessage.js"
  3. You have to send the data to the wsppSendTextMessage function in an Array
  4. The first element in the Array is the phone number where you will send the message
  5. Each element of the Array is a line of the Whatsapp text message
  6. You can use the simbols you use in the app, to format the text, for example *bold* or _italic_
  7. When you have the complete data in the Array, you are ready to call wsppSendTextMessage(data) with your Array as the first parameter
  8. The wsppSendTextMessage function ever return the processed string (the generated link to open Whatsapp)
  9. By default the wsppSendTextMessage function open a new window with the generated URL
  10. The function open the Whatsapp chat and return the processed string, but, to return the string without the Whatsapp chat, you have to add a second parameter with the value "false". Example: wsppSendTextMessage(data,false)

Important: I'm working to support QR Whatsapp links, but actually you have to specify a phone number.

Example:
Example code
Example in a form
Telephone to contact:   
Name:   
Your message:  
Generated Whatsapp URL: