django-meta-whatsapp emits four Django signals you can connect to in your host application to react to WhatsApp events — inbound messages, sent messages, campaign completions, and In-App Signup subscriptions. All four signals are defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rahul-baberwal/django-meta-whatsapp/llms.txt
Use this file to discover all available pages before exploring further.
django_meta_whatsapp.signals and follow standard Django signal conventions.
Available Signals
whatsapp_message_received
Fired when an inbound message arrives and is processed by the webhook engine. The signal is sent after the message is persisted to the database.
Provided kwargs: message — a WhatsAppMessage instance with direction="inbound".
myapp/handlers.py
whatsapp_message_sent
Defined in django_meta_whatsapp.signals for use by host-application code. Connect a receiver to this signal and dispatch it yourself whenever your application sends an outbound message to track or log sent messages.
Provided kwargs: message — a WhatsAppMessage instance with direction="outbound".
myapp/handlers.py
whatsapp_message_sent is provided as a hook for your own application code to dispatch — the library itself does not fire it automatically. Call whatsapp_message_sent.send(sender=..., message=msg_instance) from your own views or utilities after a successful send.whatsapp_campaign_completed
Defined in django_meta_whatsapp.signals for use by host-application code. Dispatch this signal from your own campaign post-processing logic to notify other parts of your application when a campaign finishes.
Provided kwargs:
campaign— aWhatsAppCampaigninstancesent— integer count of successfully sent messagesfailed— integer count of failed sends
myapp/handlers.py
whatsapp_campaign_completed is provided as a hook for your own application code to dispatch — the library itself does not fire it automatically after run_campaign() completes. Dispatch it manually in a post-campaign hook if you need cross-component notifications.whatsapp_user_subscribed
Fired when a user subscribes via an In-App Signup deep link (wa.me/PHONE/signup/ID). The webhook engine creates or updates the WhatsAppContact record before firing this signal.
Provided kwargs:
contact— aWhatsAppContactinstance (newly created or updated)signup— theWhatsAppSignupinstance the user subscribed through
myapp/handlers.py
Connecting Signals
Decorate receivers with@receiver and ensure the module containing them is imported at Django startup. The canonical place to do this is in your app’s AppConfig.ready() method:
myapp/apps.py
AppConfig is referenced in INSTALLED_APPS (either as the dotted path or via default_app_config):
settings.py
Signal receivers run synchronously in the same request/response cycle as the webhook handler. The webhook view must return a response to Meta within a few seconds or Meta will retry the delivery. Keep your receivers fast — offload any heavy work (database writes, HTTP calls, email sends) to Celery tasks queued from inside the receiver.
Signal Reference
| Signal | Dispatched by | Key kwargs |
|---|---|---|
whatsapp_message_received | WebhookView (automatically) | message: WhatsAppMessage |
whatsapp_message_sent | your application code | message: WhatsAppMessage |
whatsapp_campaign_completed | your application code | campaign: WhatsAppCampaign, sent: int, failed: int |
whatsapp_user_subscribed | WebhookView (automatically) | contact: WhatsAppContact, signup: WhatsAppSignup |