Skip to main content

WhatsApp

Use WhatsApp for appointment reminders, order updates, lead follow-up, support routing, and workflow alerts.

Example app: appointment reminders

An appointment scheduler is a good reference app for WhatsApp reminders. A practical prompt for that workflow is:

Build an appointment reminder app with React, NestJS, PostgreSQL, and WhatsApp messaging.
Users can create appointments with client name, phone number, appointment time, and notes.
Send WhatsApp reminders automatically at the configured time.
Show upcoming appointments, past appointments, delivery status, and failures.
Use server-side environment variables for all provider credentials.

Choose a WhatsApp provider

Most apps use one of these paths:

  • WhatsApp Business Cloud API for direct Meta-managed messaging.
  • Twilio WhatsApp for a provider-managed sender, templates, and delivery tooling.
  • Another approved messaging provider if your team already uses one.
WhatsApp provider setup screen
Prepare the WhatsApp sender, templates, and provider account before asking for implementation.
WhatsApp message setup screen
Use approved test recipients and templates while building.

Prepare provider details

Collect these values from your provider, then store them as server-side configuration:

WHATSAPP_PROVIDER=
WHATSAPP_ACCOUNT_ID=
WHATSAPP_AUTH_TOKEN=
WHATSAPP_FROM_NUMBER=
WHATSAPP_TEMPLATE_ID=
WHATSAPP_WEBHOOK_SECRET=

Use provider-specific names if your account requires them. Never expose auth tokens in browser code.

Twilio sandbox setup

If you use Twilio WhatsApp while building:

  1. Create or open a Twilio account.
  2. Open Messaging > Try it out > Send a WhatsApp message.
  3. Join the sandbox from the phone that will receive test messages.
  4. Copy the sandbox sender number, usually formatted as whatsapp:+14155238886.
  5. Copy the Account SID and Auth Token into server-side runtime configuration.
  6. Restart the generated backend after changing environment variables.

Phone numbers in the app should include a country code and a leading plus sign, such as +1234567890.

Prompt Cocoding AI

Add WhatsApp reminders for bookings.
Use server-side environment variables for the WhatsApp provider credentials.
Send only approved template messages.
Add an admin status field showing sent, failed, or pending.

Test safely

  1. Use a provider sandbox or test sender.
  2. Add only opted-in test recipients.
  3. Send one test event from the preview.
  4. Confirm provider delivery logs.
  5. Confirm the app stores a message status and failure reason.

Generated app example

Generated appointment reminder app with WhatsApp reminder workflow
A generated WhatsApp app should make phone format, appointment time, and delivery status clear.

Production checklist

  • Move from sandbox to an approved production sender.
  • Use approved WhatsApp templates where required.
  • Store consent or opt-in status.
  • Add retry and failure logging.
  • Add timezone handling for appointment reminders.
  • Keep provider tokens out of client-side code and screenshots.

Troubleshooting

SymptomLikely causeWhat to check
Message rejectedTemplate not approvedCheck provider template status and language.
No deliveryRecipient not opted inConfirm sandbox or business opt-in rules.
Webhook not receivedWrong callback URLCopy the deployed webhook URL into the provider dashboard.
Credential errorToken missing or wrong provider selectedVerify server-side variables and provider mode.