Skip to main content

Patient support inbox

In affiliate mode Tagada answers patient email for every brand. The storefront advertises a brand address; Resend receives it; the TGD Care desk (or a partner desk) replies as the brand. Identity (what the patient sees) and handling (who answers) are independent. Changing one never changes the other.

Addresses

Until receiving is verified, storefronts fall back to care@tgdcare.com so patients never write into the void. Storefront subdomains resolve through a wildcard ALIAS * in the tgdcare.com zone; because a wildcard stops answering for any name that gets an explicit record, ensureDnsRecords first pins <slug> with an explicit ALIAS copying the wildcard target before adding the receiving MX (otherwise <slug>.tgdcare.com silently stops resolving). That apex mailbox belongs to the TGD Care root store and is provisioned once with supportMailbox.provisionApexMailbox (same mechanics as a slug subdomain: Resend domain on the apex, MX/DKIM/SPF pushed to Vercel DNS). It must stay verified, otherwise the fallback itself bounces. Publishing an Rx storefront provisions the platform mailbox automatically. The merchant can later swap the identity to their own domain from the storefront wizard — Tagada still handles the inbox.

Who answers

A superadmin can move a mailbox from the platform desk to a partner desk without touching the address. The desk has its own CRM namespace (/rx, entry TagadaRx in the account menu) rather than a tab of the admin backoffice: it is a support surface worked by rx_ops / rx_admin, not an admin one. The old /admin/rx and /partner-admin/:partner/rx URLs redirect.

Roles

partneradmin alone does not open the desk: a white-label partner (Vera, BNP, Kashu…) gets its own Rx desk when Tagada grants rx_admin to the partner owner, who can then hand rx_admin / rx_ops to their staff from the partner IAM tab. Moving a mailbox between desks and provisioning platform mailboxes remain platform-only.

Inbound path

  1. Patient writes to the brand address.
  2. Resend POSTs email.received to /api/public/webhooks/resend/inbound (Svix-signed).
  3. Inngest rx/support.email.received fetches the body + attachments and stores the thread.
  4. Threading: In-Reply-To / References[TGD-XXXXXX] in the subject → last open conversation of the same contact on that mailbox (7 days).
  5. Auto-replies, bounces and list mail are dropped.

Outbound path

Agents reply from the desk. Resend sends from the verified brand address (PrimeRx Care <care@primerx.tgdcare.com>). The subject carries [TGD-XXXXXX] so the next patient reply threads back. The agent never appears.

Env

Create a Resend webhook on email.received pointing at https://api.tagada.io/api/public/webhooks/resend/inbound. Enable sending + receiving on each brand domain. Plan quota: Scale is required once you have more than 10 verified domains (one per affiliate subdomain).