App code never talks to Twilio, Mailgun, Resend, GoHighLevel or Stripe directly. It calls a port (sendCustomerEmail / sendCustomerSms / paymentsFor), which resolves that account's adapter chain from org_provider_bindings and walks it in priority order. Adapters are the only files allowed to speak a vendor's wire protocol. An account with no rows falls back to a platform default chain, so nothing has to be configured before it works.
Also called: provider registry · ports and adapters · switch SMS provider · not locked into one vendor · org provider bindings
- 1A send arrives at the port facade with an org id.
- 2The registry reads org_provider_bindings for that org and capability (email / sms / voice / payments), filtered to active rows, ordered by priority, cached 60 seconds.
- 3Secrets stored as enc:v1: strings are decrypted in the registry so adapters receive ready-to-use values.
- 4Each adapter in the chain is tried until one returns 'sent'; 'skipped' means not applicable, 'failed' means it tried and errored.
- 5The result is written to send_log with the provider that actually delivered it; a retryable failure lands in message_outbox.
The roadmap comment is explicit that adopting the port had to be a zero-behaviour-change deploy: 'An org with NO rows gets the PLATFORM DEFAULT chain below — which reproduces the pre-ports routing exactly... That makes adopting the port a zero-behavior-change deploy, and makes provider cutover a per-tenant config flip.' The example in the file spells out the payoff: a two-row INSERT moves a tenant to Mailgun, and 'rollback = flip status/priority back. No deploy.' Before this, who carried a builder's messages was a property of the code, so every vendor decision was permanent.
- Vendor choice was hard-coded, so switching providers meant a code change and a deploy.
- A single provider outage stopped all customer messaging with no fallback.
- Different tenants needed different stacks (one insisted on GoHighLevel, everyone else on in-house) with no way to express that.
See it on your own jobs
Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.
or keep browsing features →