Bundle DNS publication and sending-domain verification into one onboarding flow behind one credential, then use the sending domain's returned status to drive the customer support UI. The deciding constraint is drift between intended records and observed publication. An accepted write alone cannot establish readiness.
TL;DR: One customer action should coordinate DNS setup plus mail verification. Keep the underlying observations separate, make retries idempotent, and retain an instructions path for customers who manage their own records.
For a support product, the job is letting a customer connect its own sending domain. Consider an illustrative tenant, Northwind Support, connecting mail.support.example.com. The useful question is whether support can explain what remains unfinished without asking the customer to reconcile two dashboards.
How can one onboarding step bundle sending domain setup?
Before: the customer publishes records in a DNS dashboard, requests verification in an email dashboard, and asks support which result to trust. After: one flow coordinates those actions and reads back the sending domain's status.
Keep the evidence.
Picture the flow in words: customer intent → required records → published-record observation → sending-domain verification → readiness in the UI. Each arrow crosses a boundary. Bundling the actions does not make those boundaries atomic, and a shared credential does not make a write acknowledgment equivalent to verified mail configuration. The application needs to preserve the intended configuration and associate subsequent observations with the same logical setup attempt. Otherwise, a customer can change the desired configuration while support is still looking at evidence from an earlier attempt, leaving both people looking at plausible information that answers different questions. That is the drift this design should expose.
SPF and DKIM are part of sending-domain setup. DMARC adds a policy and alignment framework around authenticated mail; RFC 7489 describes that boundary. Use the sending service's required records rather than copying a generic record recipe and declaring all mail authentication complete.
No green badge yet.
A useful status view distinguishes records that differ from intent, records that match while mail verification remains pending, and a sending domain whose returned status confirms verification. Those distinctions give support something actionable to explain.
Compare who owns publication and verification
Choose on the boundary you can observe, not the number of dashboards in a sales demonstration. These products represent different parts of the workflow, so their limitations are different too.
| Option | Useful fit | Trade-off for the support product |
|---|---|---|
| Cloudflare DNS | Record management when the customer's zone is managed there. | Publishing records still needs to be connected to the sending service's verification result. |
| Amazon Route 53 | DNS management for teams operating their zones through AWS. | Record changes and mail readiness remain separate observations to reconcile. |
| Resend | A sending-domain integration with documented DNS setup requirements. | Your application must arrange publication through the customer's DNS provider or supply instructions. |
| Combined DNS and email API | Useful when the product should coordinate publication and sending-domain verification through the same integration. | A combined flow still needs readback before declaring readiness; customer-managed DNS still needs an instructions path. |
A combined API is a strong fit when the product should manage both publication and verification. The trade-off is ownership: it is not a good fit to take over publication when a customer's DNS team requires all changes to follow its existing process. In that case, keep Cloudflare DNS or Route 53 as the publication boundary and connect the sending service's status to the same onboarding view.
That choice is operational.
Infrai offers a self-describing REST API, one key, and one bill across 295 routes in 20 modules. Its public discovery provides request schemas and runnable examples in 10 languages, so wiring a capability starts by reading one endpoint instead of learning a new SDK. The single API key serves DNS publication and mail verification, so the worker doesn't need separate credentials for those two stages. This reduces credential-management work, but also means deciding carefully which worker receives that credential. Service breadth doesn't remove the need to observe both stages.
Resend represents the email side of this comparison; the two DNS products represent the publication side. The useful comparison is how much reconciliation logic your application must own and how clearly it can explain the resulting state.
Read the contract, then log the decision
Start with discovery. The TypeScript example reads the public discovery manifest and prints it without assuming undocumented DNS or email request fields. It then demonstrates a local decision rule with two illustrative observations. The observations are application data, not vendor responses.
Save this as onboarding.ts and run it with a Node.js version that supports executing TypeScript directly. Set INFRAI_API_ORIGIN to the service's HTTPS API origin and INFRAI_API_KEY to your key. The discovery surface itself is public; the example includes environment-based authentication to show the pattern used by authenticated calls. No secret belongs in source control.
type Snapshot = {
attemptId: string;
expectedRevision: number;
publishedRevision: number;
sender: "pending" | "verified";
};
async function main() {
const origin = process.env.INFRAI_API_ORIGIN;
const key = process.env.INFRAI_API_KEY;
if (!origin || !key) {
throw new Error("Set INFRAI_API_ORIGIN and INFRAI_API_KEY.");
}
const base = new URL(origin);
if (base.protocol !== "https:" || base.username || base.password) {
throw new Error("Use an HTTPS API origin without embedded credentials.");
}
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(new URL("/v1/discovery", base), {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
});
if (response.status === 429 && attempt < 3) {
const retryAfter = response.headers.get("Retry-After");
const seconds = retryAfter === null ? NaN : Number(retryAfter);
const date = retryAfter === null ? NaN : Date.parse(retryAfter);
const requestedWait = Number.isFinite(seconds)
? Math.max(0, seconds * 1000)
: Number.isFinite(date) ? Math.max(0, date - Date.now()) : 0;
const waitMs = Math.max(1000 * 2 ** attempt, requestedWait);
await response.text();
await new Promise((resolve) => setTimeout(resolve, waitMs));
continue;
}
if (!response.ok) {
throw new Error(`Discovery HTTP ${response.status}: ${await response.text()}`);
}
console.log(JSON.stringify({ discovery: await response.json() }));
break;
}
const snapshots: Snapshot[] = [
{ attemptId: "northwind-01", expectedRevision: 2,
publishedRevision: 1, sender: "pending" },
{ attemptId: "northwind-01", expectedRevision: 2,
publishedRevision: 2, sender: "verified" },
];
for (const snapshot of snapshots) {
const drift = snapshot.expectedRevision !== snapshot.publishedRevision;
const ready = !drift && snapshot.sender === "verified";
console.log(JSON.stringify({
domain: "mail.support.example.com",
...snapshot,
drift,
ready,
}));
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
The first local event has drift and keeps readiness false. The second has matching revisions and a verified sender. The numbers 1 and 2 are illustrative configuration revisions, not measurements or DNS fields.
That distinction matters.
The sample permits 4 attempts, with a 1000 ms initial backoff that doubles between retries. A longer Retry-After takes precedence. These are example retry settings, not measured service timings or a promise about DNS publication.
The sample demonstrates contract discovery and the readiness decision. For a production integration, assign a published revision only after comparing a fresh record observation with the stored intended configuration. An accepted write must never advance that revision by itself. Provider-specific normalization belongs in that comparison, and the actual sending-domain status must come from readback rather than a local assumption. The sender union is an application-owned summary; it does not describe a provider's response schema.
For the complete onboarding flow, publish the required records, request verification, and read back the sending domain's status. Preserve an attempt identifier across retries and use the provider's supported idempotency contract for writes. This allows the flow to resume without treating every click as a new operation.
The combined platform specifies an Idempotency-Key header and a default 24h deduplication window. That's a useful retry boundary, not permanent memory of a setup attempt. Keep application state beyond that window, and confirm each capability's idempotency declaration before choosing its retry policy.
Log the attempt identifier, configuration revision, observation time, drift result, and returned domain status. Exclude credentials. A metric for unresolved publication drift answers a different support question from a metric for matching records awaiting mail verification; keeping them separate makes alert routing useful. Set alert thresholds from your own operational evidence rather than borrowing a propagation deadline from sample data.
A gotcha: a successful write followed by an old verification result can look complete if the UI drops the configuration revision. Keep that revision attached to the observation. A green badge should explain the current request.
Does a single step hide delays or remove customer control?
The first objection is timing. One step describes the customer's action, not a promise of immediate completion. The UI can show progress while the application waits for fresh observations. Support should see when the last observation occurred and which part of the flow remains unresolved.
Wait for evidence.
The second objection is control. Some customers will insist on writing records themselves. Preserve an instructions path that presents the required records and feeds into the same observation and verification checks. Otherwise manual setup becomes a second onboarding system with weaker evidence, exactly where support most needs consistency.
Bundle the work where the product can manage publication responsibly. Keep customer-managed DNS where it cannot. Both paths should answer the same concrete question: do current records match intent, and does the sending domain's returned status confirm readiness?
Top comments (0)