Someone submits the inquiry form on your WordPress site, the inquiry details should be sent automatically to your WhatsApp number (not just email).
There are 2 practical methods:
Method 1: Redirect user to WhatsApp (Simple & Free)
This method opens WhatsApp with the inquiry filled in, but the user has to press send.
Example with Contact Form 7
-
Install Contact Form 7 plugin.
-
Add a hidden redirect script in
functions.php:add_action('wpcf7_mail_sent', 'redirect_to_whatsapp'); function redirect_to_whatsapp($contact_form) { $submission = WPCF7_Submission::get_instance(); if ($submission) { $data = $submission->get_posted_data(); $name = urlencode($data['your-name']); $email = urlencode($data['your-email']); $message = urlencode($data['your-message']); $whatsapp_url = "https://wa.me/919876543210?text=New%20Inquiry%0AName:%20$name%0AEmail:%20$email%0AMessage:%20$message"; echo "<script>window.open('$whatsapp_url','_blank');</script>"; } }
Replace 919876543210 with your WhatsApp number.
This will open WhatsApp with the inquiry message ready to send.
Method 2: Auto-send to WhatsApp (Professional Way)
For automatic sending (without user interaction), you must use WhatsApp Business API (Meta Cloud API, Twilio, Gupshup, etc.).
Example using Meta WhatsApp Cloud API:
-
Get WhatsApp Cloud API access token from Meta Developer Portal.
-
Get your Phone Number ID.
-
Add this code in
functions.php:add_action('wpcf7_mail_sent', 'send_whatsapp_message'); function send_whatsapp_message($contact_form) { $submission = WPCF7_Submission::get_instance(); if ($submission) { $data = $submission->get_posted_data(); $name = $data['your-name']; $email = $data['your-email']; $message = $data['your-message']; $msg = "📩 New Inquiry\n\nName: $name\nEmail: $email\nMessage: $message"; $url = "https://graph.facebook.com/v19.0/YOUR_PHONE_NUMBER_ID/messages"; $token = "YOUR_ACCESS_TOKEN"; $body = json_encode([ "messaging_product" => "whatsapp", "to" => "91XXXXXXXXXX", // Your WhatsApp Number "type" => "text", "text" => ["body" => $msg] ]); $args = [ 'body' => $body, 'headers' => [ 'Authorization' => 'Bearer '.$token, 'Content-Type' => 'application/json' ] ]; wp_remote_post($url, $args); } }
This will auto-send the inquiry details to your WhatsApp number in the background whenever a user submits the form.