Repository navigation
feat(Team-Bravos): WhatsApp Channel Plugin for MicroPowerManager (MPM) - #1710
Open
docile-imbereyemaso wants to merge 64 commits into
Open
docile-imbereyemaso wants to merge 64 commits into
docile-imbereyemaso wants to merge 64 commits into
Conversation
Merge main into our branch
Feat/opt in opt out
feat: applying template endpoints and api gateway
Feat/credentials webhooks
fix: fixing testing issues and non completed things
feat: Implement routing mechanism and message log APIs
feat: add WhatsApp channel savings report
…ice-bot feat: Implement self-service-bot
…ing-merge fix: separate opt-in prompt and self-service replies after merge
…s, add Meta pricing endpoint
…gin-cleanup refactor: whatsapp-plugin-cleanup
…_Management feat: Contacts & Consent Management Page
…ial-setup-page feat: add whatsapp credentials and Meta setup guide page
…very feat: message log and delivery tracking page
…ng_cleanup feat: Cost View, Navigation Wiring & Cleanup
…phone fix(whatsapp): opt-in search by phone and update setup guide
doc: documentation of whatsapp channel plugin implementation
…tabilization fix: credentials save, registration popup and message channel labels
Feat/whatsapp send retry
Merge updates from main into feat/whatsapp-channel-plugin
fix: restore unrelated files, document retry, translate contacts and …
Update feat/whatsapp-channel-plugin with the latest changes from main
…-approval fix: make auto-generated templates Meta-compliant
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief summary of the change made
closes: #1340
Adds a WhatsApp Messaging plugin that delivers MPM's existing notifications over the WhatsApp Business Platform (Meta Cloud API).
It plugs into the existing SMS flow: opted-in customers get the message on WhatsApp, and everyone else (or any message WhatsApp cannot deliver) still goes out through the configured SMS gateway.
Operator setup (plugin admin, no code changes)
wa.meopt-in link for receipts, posters and QR codes.WhatsApp business rules
They opt out with STOP/UNSUBSCRIBE.
Every change is stored in a consent log.
X-Hub-Signature-256), and the company is resolved from the webhook URL.Delivery failures and fallback
sms:resend-rejectedsends it by SMS.The retry re-checks opt-in and the plugin status first.
Extras
TOKEN <serial>, BALANCE or HELP, and the answers only cover their own devices and appliances.docs/integrations-guide/whatsapp.md(setup) anddocs/usage-guide/whatsapp.md(day-to-day use).Are there any other side effects of this change that we should be aware of?
Core changes outside the plugin
SmsSender::sendSms()now tries WhatsApp first and falls back to the SMS gateway when WhatsApp is unavailable or declines the message.The gateway selection moved into a new
SmsService::sendViaSmsGateway(), whichResendRejectedMessagesnow uses too.Resends always go by SMS, since a resend no longer has the values needed to fill a template.
SmsGatewayResolverService::isSmsGatewayConfigured()returnstruewhen only WhatsApp is configured.An operator can then message opted-in customers without an SMS gateway; messages to customers who have not opted in are marked failed with "no active SMS provider".
WhatsappMessagingGatewayinSmsSenderandSmsGatewayResolverService), the same way Viber already is.SmsSenderkeeps the body-parser reference and values (SmsBodyParser::variableValues()), so a notification can be rendered as a WhatsApp template.Paginatoralso reads pagination fields nested undermeta(Laravel resource collections), andPaginate/Widgetaccept an optionalmax_per_page.Existing pages are unaffected.
Database
33tompm_plugins, and a tenant migration addswhatsapp_credentials,whatsapp_contacts,whatsapp_consent_logsandwhatsapp_messages.Known limitations of the retry
sms:resend-rejecteddoes not try again.Repository note
collections/Odyssey Data Export /onmainends with a space, which Windows does not allow, so Windows contributors cannot check it out.This PR leaves it untouched; we suggest renaming it in a separate change.
Describe how you tested your changes?
Automated tests
Static checks (the same tools as CI)
npm run lang:check) and editorconfig all pass.Manual testing with a real WhatsApp number
Pull Request checklist