Send automated notifications with customizable templates in your WooCommerce Store.
Feature Overview
↑ Back to topWith the Notifications with WhatsApp, you will have an integration with WhatsApp Cloud API to automatically send purchase data to buyers and sellers for the following actions:
- New Order Notification for Sellers
- New Order Notification for Customers
- Update Order Status Notification for Customers
- Abandoned Cart Notification for Customers
- View Received Messages
Installation
↑ Back to topSee the steps to install the plugin:
- Download the extension from your WooCommerce dashboard.
- Go to Plugins > Add New > Upload and select the ZIP file you just downloaded.
- Click Install Now and then Activate.
Activation
↑ Back to topGo to menu WooCommerce > Notifications with WhatsApp:
WhatsApp Connection Settings Cloud API Credentials
↑ Back to topEnter your WhatsApp Cloud API credentials to connect your store and automatically send messages that have been configured in Message Templates.
![](https://woocommerce.com/wp-content/uploads/2024/02/whatsapp-connection-settings-cloud-api-credential-300-1-1.png?strip=all&w=704)
Enable Log Cloud API -> Enable to record a log of communication between the store and the WhatsApp Cloud API on each purchase via WhatsApp
API Token -> Get your API token from WhatsApp
API Phone Number -> Get your API Phone number from WhatsApp
WhatsApp Business Account ID -> Get your Live WhatsApp Business Account ID from WhatsApp
Phone Number To -> Get your phone number that will be sent the message on WhatsApp. Example: 5511999999999
Enable check as default the input -> Enable to check as default the input: I want to receive order notifications via WhatsApp in checkout
WhatsApp Connection Webhook callback URL
↑ Back to topSubscribe to Webhooks to get notifications about messages your business receives. Read more
![](https://woocommerce.com/wp-content/uploads/2024/02/whatsapp-connection-settings-webhook-300-1.png?strip=all&w=704)
Webhook URL -> Url that must be added in the webhook Meta
Verify Token -> Token that must be added in the webhook Meta
Message Template New Order Seller
↑ Back to topCreate the template message for sending new order messages to the seller:
![](https://woocommerce.com/wp-content/uploads/2024/02/message-template-new-order-seller-300-1.png?strip=all&w=704)
Message Template New Order Customer
↑ Back to topCreate the template message for sending new order messages to the customer:
![](https://woocommerce.com/wp-content/uploads/2024/02/message-template-new-order-customer-300.png?strip=all&w=704)
Message Template Update Order Status Customer
↑ Back to topCreate the template message for sending update order status messages to the customer:
![](https://woocommerce.com/wp-content/uploads/2024/02/message-template-update-order-status-customer-300.png?strip=all&w=704)
Message Template Abandoned Cart Customer
↑ Back to topCreate the template message for sending abandoned cart messages to the customer:
![](https://woocommerce.com/wp-content/uploads/2024/02/message-template-abandoned-cart-300.png?strip=all&w=704)
Received Messages
↑ Back to topView messages received on WhatsApp that sends notifications
![](https://woocommerce.com/wp-content/uploads/2024/02/received-view-messages-300.png?strip=all&w=704)
Usage
↑ Back to topSee how using the plugin works:
See how configure plugin:
Configuration Meta Business
↑ Back to topFor the plugin to work, you need to make some settings within Meta Business, see how to configure it below:
Tutorial
↑ Back to topSee the tutorial on how to configure Meta Business:
Create a Business Account
↑ Back to topAccess the link https://business.facebook.com and register your company, and then link this account to your business’s social networks (Facebook and Instagram)
![](https://woocommerce.com/wp-content/uploads/2023/12/create-bussiness-account.png?strip=all&w=704)
To create an account you can also check: Create a Business Account in Meta Business Manager
To link this account to your company’s social networks, you can check: Add a Page to your Business Account
Verify your business
↑ Back to topTo use WhatsApp features, it is important that you complete a Business verification.
This is necessary to be able to fully use WhatsApp Cloud API credentials without intermediaries. Only people with full control of a business account can complete this process.
To complete Business verification you can check: Verify your business
![](https://woocommerce.com/wp-content/uploads/2023/12/verify-your-business-verified.png?strip=all&w=704)
Generate WhatsApp Cloud API credentials
↑ Back to topFinally, we must generate a WhatsApp Cloud API credentials token temporary for tests.
To generate a token you can check: Using Authorization Tokens for the WhatsApp Business Platform or Add The WhatsApp Product To Your App
![](https://woocommerce.com/wp-content/uploads/2023/12/generate-whatsApp-cloud-api-credentials-temporary.png?strip=all&w=704)
Creating a Permanent Access Token
↑ Back to topKnowing that you need to use a bearer token in the Authorization header of an HTTP request is helpful, but it’s not enough. The only access token you’ve seen so far is temporary. Chances are that you want your app to access the API for more than 24 hours, so you need to generate a longer-lasting access token.
To create a system user, do the following:
- Go to Business Settings.
- Select the business account your app is associated with.
- Below Users, click System Users.
- Click Add.
- Name the system user, choose Admin as the user role, and click Create System User.
![](https://woocommerce.com/wp-content/uploads/2023/12/1-creating-a-permanent-access-token.png?strip=all&w=704)
- Select the whatsapp_business_messaging permission.
- Click Generate New Token.
- Copy and save your token.
![](https://woocommerce.com/wp-content/uploads/2023/12/3-creating-a-permanent-access-token.png?strip=all&w=704)
Add a Real Business Number
↑ Back to topWith your test business number and test WhatsApp business account, you can begin to develop your application.
When you use these test assets, you don’t pay to send messages as you work to develop your app.Once you are ready to start sending messages to your customers, you can add a real business phone number in the API Setup panel and create a real WhatsApp Business Account.
- Navigate to the Meta App that is set-up for WhatsApp by going to developers.facebook.com > My Apps > Select your App.
- Use left menu to navigate to the WhatsApp > API Setup panel.
- On the right pane select Add phone number button under Step 5: Add a phone number.
If your phone number is currently registered with WhatsApp Messenger or the WhatsApp Business App, you need to first delete it. You will not be able to use that number on the WhatsApp Business app simultaneously. Your number must be used on the Business Platform or Business App.
![](https://woocommerce.com/wp-content/uploads/2023/12/add-a-real-business-number.png?strip=all&w=704)
You can also check: Add a Phone Number
Configure Webhook Callback
↑ Back to top1 – To receive messages on WhatsApp that sends notifications In the APP go to WhatsApp > Configuration:
![](https://woocommerce.com/wp-content/uploads/2024/02/webhook-configuration.png?strip=all&w=704)
2 – In webhook, click edit and add the url and verification token generated by the plugin:
![](https://woocommerce.com/wp-content/uploads/2024/02/webhook-add-callback-url.png?strip=all&w=704)
3 – After verifying the token, in Webhook fields, click Manage, select all fields and click done:
![](https://woocommerce.com/wp-content/uploads/2024/02/webhook-fields-select.png?strip=all&w=704)
Message Templates
↑ Back to topWhatsApp message templates are specific message formats that companies use to send notifications or customer service messages to people who have opted in to receive notifications.
For the message to reach its destination, it is necessary to create the template for each model.
Tutorial
↑ Back to topSee the tutorial on how to create the messages that will be sent:
Create Message Template New Order Seller / Customer
↑ Back to top1 – Create the template message for sending notifications for Seller and/or Customer
![](https://woocommerce.com/wp-content/uploads/2024/02/create-new-order-seller-message-template-300.png?strip=all&w=704)
Name -> Name your message template
Languages -> Choose languages for your message template.
Header -> Add a title or choose which type of media you’ll use for this header
Footer -> Add a short line of text to the bottom of your message template
Body -> Enter the text for your message in the language you’ve selected
2 – After creating the model, click in button Sent to API and wait for the status to change to approved. (This approval may take up to 24 hours)
![](https://woocommerce.com/wp-content/uploads/2024/02/new-order-seller-message-template-status-peding-300.png?strip=all&w=704)
You can also track the approval status of the message template within Meta Business at: WhatsApp Manager > Account tools > Message templates
![](https://woocommerce.com/wp-content/uploads/2023/12/new-order-seller-message-template-status-meta.png?strip=all&w=704)
3 – Once approved, the status will change and the messages will be sent
![](https://woocommerce.com/wp-content/uploads/2024/02/new-order-seller-message-template-status-approved-300.png?strip=all&w=704)
Create Message Template Update Order Status Customer
↑ Back to top1 – Create the template message for sending update order status messages to the customer
![](https://woocommerce.com/wp-content/uploads/2024/02/create-new-order-status-customer-message-template-300-1.png?strip=all&w=704)
Status Order -> Choose which order status represents this template message
Name -> Name your message template
Languages -> Choose languages for your message template.
Header -> Add a title or choose which type of media you’ll use for this header
Footer -> Add a short line of text to the bottom of your message template
Body -> Enter the text for your message in the language you’ve selected
2 – After creating the model, click in button Sent to API and wait for the status to change to approved. (This approval may take up to 24 hours)
![](https://woocommerce.com/wp-content/uploads/2024/02/update-order-status-customer-message-template-status-peding-300.png?strip=all&w=704)
You can also track the approval status of the message template within Meta Business at: WhatsApp Manager > Account tools > Message templates
![](https://woocommerce.com/wp-content/uploads/2023/12/new-order-seller-message-template-status-meta.png?strip=all&w=704)
3 – Once approved, the status will change and the messages will be sent
![](https://woocommerce.com/wp-content/uploads/2024/02/update-order-status-customer-message-template-status-aproved-300.png?strip=all&w=704)
Create Message Template Abandoned Cart Customer
↑ Back to top1 – Create the template message for sending abandoned cart messages to the customer
![](https://woocommerce.com/wp-content/uploads/2024/02/create-new-abadoned-cart-message-template-300-1.png?strip=all&w=704)
Name -> Name your message template
Languages -> Choose languages for your message template.
Header -> Add a title or choose which type of media you’ll use for this header
Footer -> Add a short line of text to the bottom of your message template
Body -> Enter the text for your message in the language you’ve selected
2 – After creating the model, click in button Sent to API and wait for the status to change to approved. (This approval may take up to 24 hours)
![](https://woocommerce.com/wp-content/uploads/2024/02/new-abandoned-cart-message-template-status-peding-300.png?strip=all&w=704)
You can also track the approval status of the message template within Meta Business at: WhatsApp Manager > Account tools > Message templates
![](https://woocommerce.com/wp-content/uploads/2023/12/new-order-seller-message-template-status-meta.png?strip=all&w=704)
3 – Once approved, the status will change and the messages will be sent
![](https://woocommerce.com/wp-content/uploads/2024/02/new-abandoned-cart-message-template-status-approved-300.png?strip=all&w=704)
Update Message Template
↑ Back to topAfter editing the message, it is important that you send the changes again by clicking the Update from API button
Exclude Message Template
↑ Back to topYou can remove the message by clicking the Exclude from API button
Custom Field
↑ Back to topIf you send a custom field in a notification, you can use the notifications_with_whatsapp_before_send_fields_message hook.
See an example of how to send Tracking number and Tracking url in the message:
/**
* Fired before sending a message to WhatsApp
* This hook contains an empty string that must be the function's return with the desired value to be inserted in the custom field
* This hook contains an Order object (WC_Order) related to the message that will be triggered.
* Can be used to insert a non-default custom_field into the message.
*
* @param string $custom_field Empty string to be changed
* @param object $order Order (Wc_Order)
*/
function my_custom_hook_notifications_with_whatsapp_before_send_fields_message( $custom_field, $order ){
if ( function_exists( 'ast_get_tracking_items' ) ) {
$order_id = $order->get_id();
$tracking_items = ast_get_tracking_items($order_id);
$tracking_number='';
$tracking_provider='';
$tracking_url='';
$date_shipped='';
foreach($tracking_items as $tracking_item){
$tracking_number = $tracking_item['tracking_number'];
$tracking_provider = $tracking_item['formatted_tracking_provider'];
$tracking_url = $tracking_item['formatted_tracking_link'];
$date_shipped = date_i18n( get_option( 'date_format' ), $tracking_item['date_shipped'] );
}
}
return 'Tracking number: ' . $tracking_number . '\n Tracking url: ' . $tracking_url;
}
add_filter( 'notifications_with_whatsapp_before_send_fields_message', 'my_custom_hook_notifications_with_whatsapp_before_send_fields_message', 10, 2 );