Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress WhatsApp Bot

A robust WhatsApp bot that automates handling of WordPress form submissions, instantly engaging users, confirming their details, forwarding leads to admins, and sending email notifications. Built with Node.js, Express, and whatsapp-web.js.


🚀 Features

  • WhatsApp Integration: Receives and replies to messages, sends payment links, and answers user queries.
  • WordPress Webhook Support: Receives form submissions via POST requests.
  • Automated Confirmation: Asks users to confirm details and guides them through payment.
  • Admin Notification: Forwards new leads/orders to admin WhatsApp.
  • Email Notification: Sends formatted emails via Resend API.
  • Multi-plan Payment Links: Dynamically generates payment URLs based on user selection (duration/connections).
  • Health/Test Endpoints: Check bot/server status easily.
  • Environment Variable Driven: Configure secrets and deployment settings securely.

📦 Tech Stack

  • Node.js
  • Express
  • whatsapp-web.js
  • qrcode-terminal
  • dotenv
  • axios

🛠️ Setup & Installation

  1. Clone the Repo
    git clone <your-repo-url>
    cd wordpress-wa-bot
  2. Install Dependencies
    npm install
  3. Configure Environment
    • Create a .env file:
      RESEND_API_KEY=your_resend_api_key
      CLIENT_EMAIL=your_notification_email
      PUPPETEER_EXECUTABLE_PATH=path_to_chromium (optional)
  4. Start the Bot
    npm start
  5. Scan the WhatsApp QR Code
    • On first run, scan the QR code in your terminal with your WhatsApp app.

🔗 Webhook Endpoint

  • POST /api/form-data
    • Expects: name, phone, email, offer, connections, page_url
    • Triggers WhatsApp and email notifications.

📝 Usage

  • Integrate with your WordPress form to POST data to the bot's /api/form-data endpoint.
  • Users receive WhatsApp confirmation and payment instructions.
  • Admin gets notified of new leads/orders on WhatsApp and email.

⚙️ Scripts

  • npm start — Run the bot
  • npm run dev — Run in development mode

📄 Dependencies

See package.json for full list:

  • express
  • whatsapp-web.js
  • qrcode-terminal
  • dotenv
  • axios
  • body-parser

👤 Author

  • Aditya
  • [Your GitHub profile link or contact]

📝 License

This project is licensed under the ISC License.

About

A Node.js + Express WhatsApp automation bot that handles subscription requests from a WordPress site. It receives form submissions via webhook, sends personalized WhatsApp confirmation messages to clients, detects keyword (confirm, modify, or ask questions), sends admin notifications, and emails order details using the Resend API.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages