Dashboard

← Back to Guides

WhatsApp Notifications

Connect the WhatsApp Business API so customers automatically receive booking confirmations, tour reminders, and review requests.

Prerequisites

  • A Facebook Business account (business.facebook.com)
  • A phone number that can receive SMS for verification
  • Admin access to your BestPhuketGuide dashboard

Step 1: Create a Meta App

  1. Go to developers.facebook.com
  2. Click My AppsCreate App
  3. Select Business as the app type
  4. Enter app name: BestPhuketGuide WhatsApp
  5. Select your Business account and click Create App

Step 2: Add WhatsApp Product

  1. In your app dashboard, click Add Product
  2. Find WhatsApp and click Set Up
  3. Select your Business account when prompted

Step 3: Get Your Phone Number ID

  1. Go to WhatsApp → API Setup in the left sidebar
  2. You'll see a test phone number provided by Meta
  3. Copy the Phone Number ID (a long number like 123456789012345)
  4. Save this — you'll need it for the admin panel
Tip: The test phone number can only send to numbers you add to the "To" field in the Meta Developer dashboard. For production, add your own business phone number.

Step 4: Add Your Business Phone Number (Production)

  1. Go to WhatsApp → Phone Numbers
  2. Click Add Phone Number
  3. Enter your business phone number (e.g., +66 86 470 3996)
  4. Verify via SMS or voice call
  5. Once verified, copy the new Phone Number ID

Step 5: Generate a Permanent Access Token

The test token expires in 24 hours. For production, create a system user token that doesn't expire:

  1. Go to Business Settings → System Users
  2. Click Add → name it whatsapp-api → role: Admin
  3. Click the system user → Generate New Token
  4. Select your WhatsApp app
  5. Check these permissions: whatsapp_business_messaging and whatsapp_business_management
  6. Click Generate Token
  7. Copy and save the token immediately — it won't be shown again
Warning: The access token gives full access to send messages from your business number. Store it securely and never expose it in client-side code.

Step 6: Configure in Admin Panel

  1. Go to Settings → Notifications
  2. Toggle Enable WhatsApp notifications ON
  3. Enter your Phone Number ID (from Step 3 or 4)
  4. Enter your Access Token (from Step 5)
  5. Choose which notifications to enable:
    • Booking confirmation — sent when payment is confirmed
    • Tour reminder — sent day before at 6 PM Phuket time
    • Review request — sent 24 hours after the tour
  6. Click Save Notification Settings

Step 7: Send a Test Message

  1. Still on the Notifications tab, find the Send Test section
  2. Enter your phone number in international format (no + or spaces, e.g. 66864703996)
  3. Click Send
  4. You should receive a WhatsApp message within seconds
Tip: If using the Meta test phone number, add your own number to the "To" recipients list in the Meta Developer dashboard first.

How Notifications Work

Booking Confirmation

  • Stripe: sent after successful Stripe webhook
  • Bank transfer: sent immediately on booking creation
  • Cash: sent immediately on booking creation
  • • Content: booking ref, tour name, date, guests, total, meeting point, departure time

Tour Reminder

  • • Cron job runs hourly, sends reminders at 6 PM Phuket time (UTC+7)
  • • Sent the day before the tour date
  • • Includes tour details and what-to-bring checklist
  • • Deduplication: won't send the same reminder twice

Review Request

  • • Sent 24 hours after the tour date
  • • Includes a link to the review submission page
  • • Can also be sent manually from the Bookings page

Example Message Format

Messages are sent as plain text (not Meta templates) for flexibility:

✅ *Booking Confirmed!* Hi John, Your booking has been confirmed: 🎫 *Ref:* BPG-ABC123 🚤 *Tour:* Phi Phi Islands Day Trip 📅 *Date:* 2026-04-15 👥 *Guests:* 2 adults, 1 child 💰 *Total:* ฿3,500 📍 *Meeting Point:* Chalong Pier, Phuket ⏰ *Departure:* 08:00 Please save your booking reference. Show it to your guide on the day. Questions? Reply to this message or call us. _Best Phuket Guide_

Troubleshooting

Messages not sending?

  • 1. Check the Email Log page — WhatsApp messages are logged there too
  • 2. Verify your Access Token hasn't expired
  • 3. Ensure the recipient's number is in international format (no +, no spaces)
  • 4. Check Meta Developer dashboard for API errors

"dev mode" appearing in logs?

WhatsApp is not configured — messages are only logged to console. Go to Settings → Notifications and enter your credentials.

Hitting rate limits?

Meta WhatsApp Cloud API free tier: 1,000 conversations/month. For higher volume, create pre-approved message templates in WhatsApp → Message Templates in Meta Business Manager.

Cost Estimate

VolumeMonthly Cost
Up to 1,000 conversationsFree
1,000–5,000 conversations~$5–40/month
5,000–10,000 conversations~$40–80/month

A "conversation" = 24-hour messaging window with one customer. Sending confirmation + reminder on the same day counts as 1 conversation. Next-day reminder is a separate conversation.

Security Notes

  • The Access Token is stored in your D1 database (site_settings table)
  • For production, consider moving it to Cloudflare Worker Secrets: wrangler secret put WHATSAPP_ACCESS_TOKEN
  • Never expose the token in client-side code or commit it to git
  • The token has permission to send messages from your business number — treat it like a password

Related Guides