Manage Your WhatsApp Business from Joomla

You can manage your WhatsApp Business Account (WABA) from Joomla website and send automatic messages to your users.

Step 1: Facebook (Meta) Channel Integration

The first step is to create a channel of type Facebook and then establish connection to the Facebook.

Click Here for Details

Then under the Options Tab > Services, select WhatsApp.

Step 2: Configuration and Testing

From the Facebook developers page, navigate to Use cases. Then, add Use case "Connect with Customers through WhatsApp".

Under Use cases, click Customize > API Setup.

From: Select Phone number (or add first), you will get Phone number ID and WhatsApp Business Account ID. Enter these two under Channel options.

To: Select the phone number (add your phone number) to send the test message.

Click "Generate access token" and provide required permissions.

Click "Send message". You should receive test message to your WhatsApp.

Step 3: Update System User Access Token

Navigate to Business Settings > Users > System Users. Click the three dots and Assign assets. Assign WhatsApp accounts with Full control.

Generate the token again with updated permissions. Update the generated token under Channel options.

To check if the integration is successful, while viewing channel:

  • You should see the updated scoped for the System User
  • WhatsApp Business Account details will be displayed.

Step 4: Configure Webhook

This will allow the component to receive WhatsApp messages.

Callback URL

https://domain.com/index.php?option=com_tftools&task=facebook.webhook&id=<channel_id>&format=raw

Replace domain.com with your domain name and <channel_id> with the ID of back-end channel.

Verify Token

This is the same as the Cron Token in the component options.

Click "Verify and save". Subscribe to the messages Webhook.

Step 5: Add Task

Now, we add task to get the data and perform multiple actions when Facebook will send the message alert.

From the component dashboard, navigate to the Tasks. Create a new task:

  • Trigger: Facebook Alerts
  • Action: Send Email - Turn on Debug mode to see what is included in the data.

Click on the "Test" from Facebook developer webhook configuration to test it.

Other Possible Actions

  • Store the message in the database
  • Reply to the message

WhatsApp API

WhatsApp Business Accounts (WABA): It represents your business, storing metadata and linking to phone numbers, templates, and analytics.

Business Phone Numbers: Business phone numbers, real or virtual, are used for sending and receiving WhatsApp messages.

Message Templates: Templates are customizable messages that you can construct before sending them. Only template messages can be sent to WhatsApp users outside of a customer service window.

WhatsApp Manager: WhatsApp Manager is used for managing WABAs, phone numbers, templates, and reviewing analytics.

Customer Service Window: When a WhatsApp user messages you, a 24-hour timer called a customer service window starts. If the user messages again before the timer expires, the timer resets to 24 hours. During a customer service window, you can send any message.

Templates: Template messages are the only type of message that can be sent to WhatsApp users outside of a customer service window, so templates are used when when you need to message a user, but no customer service window is open between you and the user.

  • Category: Each template is categorized as authentication, marketing, or utility.
  • Components: Templates are made up of text, media, and interactive UI components.

Templates are made up of four parts: header, body, footer, and buttons. The only required part is body.

  • Text header: Each template can include only one text header.
  • Body: It represents the core text of your message template and is a text-only. It can include multiple parameters or variables.
  • Footer: Footers are text-only components that appear immediately after the body.
  • Buttons: Buttons are perform specific actions when tapped.
    • Copy code
    • Multi-product message
    • One-time password
    • Voice call
    • Phone number
    • Quick reply
    • Single-product message (SPM)
    • URL