TenanciTenanci

Help centerYour app's customers

Email from the customer's domain

Send emails from your SaaS domain or from each customer's domain (hello@joesbarbershop.com), with DNS verification and sending through the API.

Available on: Growth, ScaleOpen in the dashboard

The emails Tenanci sends on your behalf, and the ones your app sends through the API, can come from your domain or from each customer's domain instead of a generic address. A barbershop's client gets the reminder from bookings@joesbarbershop.com, with the shop's name, and replies straight to the shop.

Project or domain

You can set up a sending domain in two places:

Where What for Example
Project → Customization tab → Customers tab your SaaS sender, for every domain in the project without its own Agenda Fácil <hello@agendafacil.com>
Domain → Settings tab a single customer's sender Joe’s Barbershop <bookings@joesbarbershop.com>

When sending, the domain's verified sender wins; if it has none, the project's is used.

Set up the sending domain

  1. Open the customer's domain and go to the Settings tab (or, for your SaaS sender, the project → Customization → Customers).
  2. In the Email sending domain card, check the Sending domain (on a domain, the customer's own address is suggested).
  3. Fill in the Sender name (for example, "Joe’s Barbershop").
  4. In Address (before the @), choose what goes before the @ (the default is contato).
  5. If replies should go to a different address, fill in Reply to (optional).
  6. Click Save and generate DNS records.

Once verified, to change just the name or the address, edit it and click Save: no new verification needed. Changing the Sending domain generates new records.

DNS records and verification

After saving, the card shows Create these records in the domain's DNS: three records (a verification code, DKIM and DMARC), with type, name and value, each with a copy button.

  1. Create the records at the sending domain's DNS provider (see DNS for provider-by-provider steps).
  2. Come back to the card and click Check now, or just wait: verification also runs on its own every 10 minutes for the first 3 days after setup.
  3. Each record that's found gets a check mark. When they're all right, the card shows Verified.
Status Meaning
Waiting for DNS the records haven't been found yet
Verified ready: emails now go out from this sender
Failed — check the records it was verified and a record has since disappeared or changed

What goes out from the sender

To remove the sending domain, click Remove in the card.

Send emails through the API

With POST /emails, your app sends emails from the domain's (or the project's) verified sender. The key needs domains:write.

curl -X POST https://api.tenanci.com/v2/emails \
  -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "domainId": "dom_4h7n1q",
    "to": ["client@gmail.com"],
    "subject": "Your appointment is tomorrow at 3pm",
    "html": "<p>See you tomorrow! Just reply to this email if anything comes up.</p>",
    "fromLocal": "bookings",
    "replyTo": "joe@joesbarbershop.com"
  }'
# → { "from": "Joe’s Barbershop <bookings@joesbarbershop.com>", "results": [{ "to": "client@gmail.com", "status": "sent" }] }
Field What it is
domainId the customer's domain; decides which sender is used
to one address or a list of up to 50
subject subject line, up to 200 characters
html and/or text the content (at least one); without text, a plain-text version is generated from the HTML
fromLocal optional: changes what goes before the @ for this send only, on the same sending domain
replyTo optional: changes the reply-to address for this send only

Each recipient gets a separate email and never sees the others. The response carries the result for each one (sent or failed). Recent sends show up in the domain's card under Latest sends through the API, and in GET /domains/:id/emails.

The sending domain can be set up through the API too: PUT /domains/:id/sender with domain, fromName, fromLocal and replyTo, then POST /domains/:id/sender/verify. For the project, the same routes under /projects/:id/sender.

Limits and errors

Response When
400 sender_not_verified neither the domain nor the project has a verified sender
400 invalid_email invalid recipient, more than 50 recipients, or missing subject/content
409 sender_taken the sending domain is already in use in another project or domain
429 email_limit the organization went over its sending limit for the last 24 hours
403 feature_not_in_plan the organization isn't on Growth or Scale