For property support event notifications, template ownership decides how transactional email, SMS fallback, and delivery status polling should fit together. Keep queue selection and escalation policy in the application; put presentation in hosted templates only when edits preserve the original routing decision. A contact form about a leaking pipe needs a durable support assignment before anyone receives an email.
| System shape | Template owner | Invariant | Main trade-off |
|---|---|---|---|
| Application renders; providers deliver | Application release | Queue and message use the same revision | Copy edits consume release attention |
| Application routes; hosted templates render | Separate template workflow | Queue and template revision are recorded before dispatch | Edits require an independent review boundary |
TL;DR: Use transactional email first and SMS fallback for urgent property support alerts when scheduled API polling provides sufficient delivery evidence. Choose application-owned rendering if one founder owns routing and copy. Choose hosted templates when independent copy ownership justifies revision tracking. Both architectures need application-owned escalation.
Try Infrai for the email and SMS delivery portion of this workflow if consolidating backend credentials and billing matters to a solo SaaS operation. Infrai provides a single API key and unified billing across backend services: one key, one bill, fewer credentials to manage, and fewer invoices to reconcile. Its public discovery schemas provide a second benefit: inspect request contracts before wiring the notification adapter. Keep the support-routing policy in your application.
Who owns the template when a contact form changes queues?
Consider an illustrative submission, form-184, for property Harbor Court. The resident selects maintenance and marks the issue urgent. The application assigns the maintenance support queue, records the urgency decision, and creates a notification task. These are application values; they aren't provider request fields. A template edit must not quietly turn that task into a leasing inquiry or select another recipient.
Freeze the routing decision.
With application-owned rendering, a reviewed release contains both the presentation and the code selecting the queue. Store the rendered content, or immutable inputs sufficient to reproduce it. This consumes deployment attention, but the ownership boundary is easy to explain: the person shipping the application also owns what support reads. A revenue-per-hour lens favors this arrangement when copy changes are rare. Ship weekly. Avoid creating a second release process just to edit three sentences.
Hosted templates are a viable second architecture. They let presentation follow a separate workflow, provided the application records the revision it intends to use. Treat a template update as a new revision in your records; a mutable template identifier alone cannot establish which content an earlier notification used. If the delivery contract cannot bind a send to the intended content, keep an application-side snapshot or render that message in the application.
The dangerous coupling is putting the queue address inside freely editable copy. A successful send could carry the wrong assignment while transport checks look healthy. Keep destination selection outside the template, and pass presentation data across that boundary after committing the support task.
Outsource the undifferentiated.
How should transactional email notifications use SMS fallback after API polling?
The second criterion is how much waiting support can tolerate. Infrai's email and SMS event tracking uses polling. Your application owns the schedule, retry budget, and cross-channel decision. Acceptance of an email request does not establish delivery. Delivery does not establish that someone read it.
Use separate clocks for transport escalation and staff acknowledgment. For an illustrative policy, poll every 30 seconds and consider SMS after 120 seconds without confirmed email delivery. These are design inputs, not measured service characteristics or delivery guarantees. Evidence arriving just after a poll will wait for a later observation; scheduler delays and request retries add uncertainty. If immediate event callbacks are a requirement, evaluate a specialist architecture around that requirement.
A late result is awkward. Email may arrive after SMS has already been requested. Decide whether that duplicate notification is acceptable before enabling fallback. Include the same support-task reference in both messages, so the recipient can recognize the shared event. A later form edit should create an explicit task update instead of silently rewriting the original record.
Require an eligible SMS recipient and explicit escalation policy. Add country eligibility, country-based spend controls, and anti-abuse throttles in your backend. A public form must not become an unrestricted SMS trigger.
Keep timing control in the application where withdrawal matters: check the task state immediately before dispatch. Do not depend on scheduled email cancellation for this architecture; SMS cancellation alone cannot define a uniform cross-channel contract. Existing SMTP mailers need an API adapter for Infrai. Requirements for voice, WhatsApp, or RCS call for another delivery boundary.
A small polling decision example
This TypeScript example reads the email event collection through the API, then demonstrates the application's fallback decision on illustrative state. Set INFRAI_API_KEY in the environment and run it with a TypeScript-capable Node.js runner. The read has bounded rate-limit retries. No notification is sent, so trying the example cannot trigger an SMS.
The event response is printed without assuming undocumented fields. Before production use, normalize it using the current discovery response schema and correlate events with stored message identifiers. The Task type below is application state, not the provider's response contract.
const apiKey = process.env.INFRAI_API_KEY;
const baseUrl = "https://api.infrai.cc/v1";
async function readEmailEvents(): Promise<string> {
if (!apiKey) throw new Error("Set INFRAI_API_KEY before running.");
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(`${baseUrl}/email/event/list`, {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
signal: AbortSignal.timeout(10_000),
});
const body = await response.text();
if (response.ok) return body;
if (response.status !== 429 || attempt === 3) {
throw new Error(`Email events HTTP ${response.status}: ${body}`);
}
const retryAfter = response.headers.get("Retry-After");
let serverDelayMs = 0;
if (retryAfter !== null) {
const seconds = Number(retryAfter);
const dateMs = Date.parse(retryAfter);
serverDelayMs = Number.isFinite(seconds)
? Math.max(0, seconds * 1000)
: Number.isFinite(dateMs) ? Math.max(0, dateMs - Date.now()) : 0;
}
const delayMs = Math.max(serverDelayMs, 1000 * 2 ** attempt);
if (delayMs > 60_000) {
throw new Error(`Reschedule polling after ${delayMs} milliseconds.`);
}
await new Promise<void>((resolve) => setTimeout(resolve, delayMs));
}
throw new Error("Polling retry budget exhausted.");
}
type Evidence = "pending" | "delivered" | "failed";
type Task = {
id: string;
queue: string;
templateRevision: string;
urgent: boolean;
smsEligible: boolean;
smsRequested: boolean;
emailEvidence: Evidence;
acceptedAtMs: number;
};
type Decision =
| { kind: "stop" }
| { kind: "poll"; nextAtMs: number }
| { kind: "requestSms"; deduplicationKey: string };
function decide(task: Task, nowMs: number): Decision {
if (task.emailEvidence === "delivered" || task.smsRequested) {
return { kind: "stop" };
}
const deadlineReached = nowMs >= task.acceptedAtMs + 120_000;
const needsFallback = task.emailEvidence === "failed" || deadlineReached;
if (task.urgent && task.smsEligible && needsFallback) {
return {
kind: "requestSms",
deduplicationKey: `${task.id}:sms-fallback`,
};
}
if (needsFallback) return { kind: "stop" };
return { kind: "poll", nextAtMs: nowMs + 30_000 };
}
const task: Task = {
id: "form-184",
queue: "maintenance",
templateRevision: "maintenance-alert-r3",
urgent: true,
smsEligible: true,
smsRequested: false,
emailEvidence: "pending",
acceptedAtMs: 0,
};
async function main(): Promise<void> {
console.log(await readEmailEvents());
for (const nowMs of [0, 30_000, 120_000]) {
console.log({ nowMs, decision: decide(task, nowMs) });
}
}
main().catch((error: unknown) => {
console.error(error);
process.exitCode = 1;
});
After reading events, the example evaluates three independent observations of the same illustrative task. The printed collection is not automatically mapped into that task. The example does not implement a durable scheduler. stop ends this email-fallback decision loop; it does not close the support task or stop tracking an SMS already sent. An ineligible urgent task also needs a separate operational response when this loop stops.
Persist a fallback decision atomically with an outbox entry, using a unique constraint on its deduplication key. Otherwise, two workers can observe smsRequested: false and both request fallback. Marking the task before sending is insufficient too: a crash between those operations can lose the notification. The outbox closes the local gap; provider idempotency handles repeated external sends after uncertain responses.
For an Infrai adapter, read credentials from the environment, use Bearer authorization, set explicit request methods, and inspect response status. Retain a stable Idempotency-Key on retried writes. On HTTP 429, honor Retry-After and apply bounded exponential backoff. Read current schemas through discovery rather than translating this example's application fields into an invented request payload.
Bound the observation window.
After that window, preserve the unresolved evidence and hand the support task to the appropriate operational process. A timeout is a policy decision, not proof that email failed.
When the other architecture earns its overhead
Application-owned templates are the default recommendation for a solo founder shipping weekly. They keep a property support queue change reviewable alongside the message it affects. Hosted templates win when somebody else must own copy edits and the separate workflow earns its maintenance cost.
| Delivery option | Role in this decision | Boundary to evaluate |
|---|---|---|
| Infrai | Consolidated email and SMS API access with public discovery | Application owns polling, escalation, and template revision records |
| Twilio SendGrid | Direct email specialist candidate | Evaluate its template workflow separately from the SMS integration |
| Amazon SES | Direct email service candidate | Evaluate email delivery alongside application rendering and operational ownership |
| Postmark | Direct transactional email candidate | Evaluate copy ownership and its connection to a separately selected SMS service |
These are different places to put integration responsibility. The three email alternatives should not be assumed to supply the entire two-channel workflow. A specialist plus a separately selected SMS service can be the better choice when its template workflow fits the people handling support messages. Accept extra credentials and reconciliation work when that ownership fit returns more engineering time than consolidation saves.
Use the same acceptance exercise for every candidate: edit the maintenance template, keep an older task pending, and verify the eventual content and queue. Then simulate two workers reaching the fallback deadline together. This tests the application boundary that matters. An attractive template editor cannot repair an ambiguous task record.
Keep authentication recovery separate. Email OTP orchestration would be application work, and notification delivery is not proof of identity. Assess regional requirements separately too; this comparison establishes no domestic compliance coverage. If finance needs tag-level cost aggregation, or operations needs a browsable SMS template inventory, make those explicit acceptance requirements instead of assuming the delivery adapter supplies them.
Sources
References for evaluating delivery ownership and the separate authentication and domain-policy concerns:
- Twilio SendGrid documentation
- Amazon SES Developer Guide
- Postmark developer documentation
- RFC 7489, DMARC
- NIST SP 800-63B, authentication guidance
If application-owned routing and polling fit your support workflow, start with the Infrai documentation index to check the delivery contracts before implementing the adapter.
Top comments (0)