Prerequisites
Set up a tenant
1
Create a brand for the customer
Open and create one brand per customer org with their logo, colors, and footer. Copy its brand ID.One brand serves every template that org receives, so this is the only place their visual identity lives. See for what a brand controls.
2
Create the tenant
takes an id you choose, so the same call creates the tenant on signup and updates it on every change after. Point it at the brand you just made.Setting
brand_id on the tenant makes branding automatic. On any send that names this tenant, Courier picks the tenant’s brand without a brand_id on the request.3
Set the org's notification defaults
Give the tenant
default_preferences so a new user in that org starts opted in or out to match the org, before they ever open a preference center. See for the per-topic calls.4
Add users to the tenant
Put each of the org’s users in the tenant so membership drives who receives a fan-out send. Add them one at a time, or in one call with
bulk_add_user_tenants.A user can belong to more than one tenant, which matters for the send shape you choose next.Send with the tenant
1
Notify one user in their org's context
Set The user’s own stored profile and preferences still win over the tenant’s, so a person who opted out stays opted out.
context.tenant_id on the recipient. The message renders with that org’s brand, and preference lookups scope to that org.2
Notify the whole org
Put a Every targeting shape, including walking a tenant hierarchy up or down, is in .
tenant_id in to and Courier looks up the tenant’s members and sends to each one.3
Give one org different content (optional)
When an org needs its own wording, not only its own colors, create a tenant template and reference it as
template: "tenant/<template_id>". Courier merges its content over the message. See .To let the customer write that wording themselves, .Verify
1
Confirm the brand resolved
Send to a user in the tenant, then open the message in . The output should carry that org’s logo and colors, not your workspace default.
2
Compare two tenants
Send the same template to a user in a second tenant and confirm the two rendered messages differ only by brand.
3
Check the fan-out count
Send with
to.tenant_id and confirm the log shows one message per member of that tenant.Troubleshooting
Which isolation layer to reach for, tenant against environment against workspace, is covered in . The merge rules behind all of the above are in .