0

I want to create a form on y website with Fields: Checkin Date, Chekout Date, Number of guests. When user fill these and click on submit, it shall create custom whatsapp link and it will open whatsapp on user's device to send message. The submit url will look something link:

https://wa.me/MYNUMBER?text=I%27m%20interested%20in%20your%20property%20Chekin:%2010april%20Checkout:%2015april%2010Guests.%20Please%20provide%20quote

Can anyone help how to code this?

I tried making wordpress custom form but unable to achive the result. I'm thinking some API expert can help me.

1 Answers1

0

I would suggest you go through How to send information entered in a form to WhatsApp?. It clearly mention the usage of the below API end point.

https://wa.me/PHONE_NUMBER?text={{ submission_text | url_encode }}

The only thing you need to add here would be the actual PHONE_NUMBER and the actual text message within the {{ ... }} in the link

Suggestion :

You can create a function that can be called onClick / onSubmit for the submit event, which actually concatenate the result from multiple form fields (here Checkin Date, Chekout Date, Number of guests ) to create a string and send a request to the above given url. I think that would solve the issue and serve the purpose that you need.

Jishnu
  • 151
  • 1
  • 2
  • 12