A WordPress plugin that allows administrators to send WhatsApp Business API template messages (HSM - Highly Structured Messages) directly from the WordPress admin dashboard, with full message logging and history tracking.
This plugin is designed to initiate WhatsApp conversations outside the 24-hour window when your existing systems (like 3CX) cannot do so. Once a customer replies to the template message, your regular WhatsApp Business system can take over the conversation normally.
- Send WhatsApp Template Messages via Meta Cloud API
- Auto-fetch approved templates from your WhatsApp Business Account
- Dynamic parameter filling with real-time template preview
- Language selection support (English
enand English USen_US) - Complete message logging with timestamp, sender, and API response
- Message history viewer with search and pagination
- Phone number validation with international format support
- Secure admin interface with proper nonce verification
- Easy setup with connection testing
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Meta WhatsApp Business Account with:
- Verified phone number
- Approved message templates
- WhatsApp Cloud API access
- Required permissions:
whatsapp_business_messagingandwhatsapp_business_management
- Download the plugin files
- Upload to
/wp-content/plugins/whatsapp-template-sender/ - Activate the plugin through WordPress admin
- Configure API credentials in Settings
- Create a Meta App: Go to Facebook Developers and create a new app
- Add WhatsApp Product: Add WhatsApp Business API to your app
- Generate Access Token: Create a permanent access token with required permissions
- Get Phone Number ID: Find your phone number ID in WhatsApp API configuration
- Get Business Account ID: Find your WhatsApp Business Account ID (WABA ID) in Meta Business Manager
Navigate to WhatsApp Templates > Settings in your WordPress admin and enter:
- Access Token: Your WhatsApp Cloud API access token
- Phone Number ID: Your WhatsApp Business phone number ID
- Business Account ID: Your WhatsApp Business Account ID (WABA ID)
Click Save Settings and verify you see "Connection successful".
Create and get approval for message templates in Meta Business Manager. Templates support parameters using {{1}}, {{2}}, etc.
- Go to WhatsApp Templates > Send Message
- Enter recipient phone number (with country code, e.g.,
18761234567) - Select a template from the dropdown (shows only approved templates)
- Choose template language (
enoren_USbased on your template) - Fill in parameters if required by the template
- Click Send Message
- Go to WhatsApp Templates > Message History
- View all sent messages with details:
- Date and time sent
- Recipient phone number
- Template used
- Parameters sent
- Sending admin
- Status (sent/failed)
- Filter by phone number or use pagination
- Send Messages:
POST https://graph.facebook.com/v19.0/{phone_number_id}/messages - Fetch Templates:
GET https://graph.facebook.com/v19.0/{business_account_id}/message_templates - Connection Test:
GET https://graph.facebook.com/v19.0/{phone_number_id}
The plugin creates a custom table wp_whatsapp_templates with:
CREATE TABLE wp_whatsapp_templates (
id bigint(20) NOT NULL AUTO_INCREMENT,
phone_number varchar(20) NOT NULL,
template_name varchar(100) NOT NULL,
parameters text,
sent_by bigint(20) NOT NULL,
sent_at datetime DEFAULT CURRENT_TIMESTAMP,
status varchar(20) DEFAULT 'sent',
api_response text,
PRIMARY KEY (id)
);- Admin-only access: Only users with
manage_optionscapability can use the plugin - Nonce verification: All forms include CSRF protection
- Input sanitization: All user inputs are properly sanitized
- Secure credential storage: API credentials stored as WordPress options
"No templates found"
- Verify your Business Account ID is correct
- Ensure templates are approved in Meta Business Manager
- Check API permissions include
whatsapp_business_management
"Template name does not exist in the translation"
- Try switching between "English (en)" and "English (US) (en_US)" language options
- Verify the template language in Meta Business Manager matches your selection
"Connection failed"
- Double-check your Access Token and Phone Number ID
- Ensure your access token has required permissions
- Verify your WhatsApp Business Account is active
Phone number format errors
- Use international format with country code (e.g.,
18761234567for Jamaica) - Remove any spaces, dashes, or special characters
Enable WordPress debug logging and check for API response details in failed message logs through the Message History page.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GPL v2 or later - see the LICENSE for details.
For issues and feature requests, please open an issue on GitHub.
Note: This plugin is designed to work alongside existing WhatsApp Business solutions like 3CX. It handles template message initiation, while your existing system manages ongoing conversations.