The page an on-call engineer needs is specific: a logistics compliance notice has reached its evidence deadline without a recorded delivery outcome. In this design example, the screen shows notice LC-155, an accepted email attempt, an old status observation, and no authorized SMS fallback. The operator needs the next action, not a reassuring count of successful API requests.

Short answer: use the existing mail integration plus an application-owned delivery ledger when that is enough. For US/EU event notifications that can tolerate polling, an API combining email, SMS, and DNS can reduce integration work, provided the application owns retry backoff, status reconciliation, and the audit record. Prefer event callbacks when the required response time leaves too little room for polling.

My preference for Go here is an implementation choice: keep the dispatch worker, cancellation context, and reconciliation checks in one small executable. A Node.js application can use the same design. This is a proposed runbook, not an account of a production incident or a measured comparison.

How should email and SMS API polling expose delivery status before a compliance deadline?

An accepted send request is the start of the investigation. It is not proof that the notice reached its recipient, and a delivery status is not proof that a person read or legally acknowledged it. The organization must define which evidence satisfies its compliance obligation.

No provider selection settles that question.

Work backwards from that requirement. Record the business notice identifier, recipient reference, channel, provider message identifier, request time, observation time, and the original status evidence. Those are proposed fields in your own ledger, not a provider response schema. Keep the notice version too: evidence about yesterday's wording cannot establish delivery of today's amended notice.

Then instrument the gap between the last observation and now. A quiet event feed can mean no new event, a stalled poller, or an observation that has not yet caught up. Those conditions need different actions. Track poll execution separately from message progress so an on-call engineer can distinguish them without manually reconstructing the worker history. If the email is still unresolved when the business deadline approaches, inspect its latest status before deciding whether an SMS attempt is justified.

Preserve the evidence.

For an illustrative policy, suppose the business allows 15 minutes to obtain a qualifying outcome and the worker polls every 60 seconds. Neither number is a provider guarantee. The polling interval adds observation delay, and backoff adds more; a threshold equal to one polling interval will be noisy whenever a poll is delayed. Schedule reconciliation independently of dispatch so a stopped sender does not also stop the process that detects missing evidence.

The integration decision starts at the DNS handoff

A notification worker is only part of the integration effort. The sending domain's DNS configuration and its mail verification must agree. Treat SPF and DKIM configuration as an operational dependency: record which domain and record change belong to the mail setup, check verification before enabling dispatch, and repeat that check after a key rotation.

A DNS write alone does not establish successful verification.

Infrai puts DNS and email behind one API key and one REST API, within a surface of 295 routes across 20 modules, reducing the separate credential and adapter work at this handoff. Its self-describing API exposes public JSON Schema without authentication, so the team can inspect the two operations before distributing a production credential. The worker uses plain HTTP with no SDK dependency, which keeps this Go handoff small. That fits a logistics team accepting pull-based email and SMS observations, API-only email sending, and application-owned retry logic. The combined approach also means one vendor to trust, one bill, and one shared outage surface.

The trade-off is polling-only delivery visibility: there are no webhooks for email or SMS. This option is not suitable for a workflow requiring event callbacks to initiate cross-channel decisions. Choose Resend or SendGrid with Twilio when their callback mechanisms fit that requirement and the team can operate the receivers.

The alternative deserves a concrete accounting. Cloudflare plus Resend normally means two service accounts and two credential sets, with glue to transfer mail-required DNS records, check their publication, and request mail-domain verification. Route 53 plus Amazon SES can remain inside one AWS account and an IAM permission model, although DNS changes and mail identity verification still need orchestration. Count those differences honestly; two services don't automatically mean two signups.

Stack Where integration work lands When I would favor it
Cloudflare + Resend + Twilio DNS publication, mail events, and SMS callbacks require separate adapters and correlation into the notice ledger. The team values dedicated channel integrations and can operate callback ingestion.
Route 53 + Amazon SES + Twilio AWS identity and DNS setup stay together; SMS status and cross-channel correlation add another integration. The application already uses AWS permissions and operational tooling.
Cloudflare + SendGrid + Twilio Separate DNS, email Event Webhook, and SMS status callback handling require shared notice identifiers. Existing channel expertise outweighs the benefit of reducing adapters.

These are architecture choices, not a claim that a callback guarantees immediate delivery. Resend, SendGrid, and Twilio document event or status callback mechanisms; receivers still need authentication checks, duplicate handling, and durable processing. Polling trades an inbound event receiver for a scheduled reconciliation worker. Compare that work against the team's existing infrastructure before choosing.

Make the handoff explicit without guessing API fields

The following Go program is a small schema-driven handoff runner. It creates a DNS record, extracts a value from that actual response, inserts it at a configured location in a mail-domain verification request, and submits that request using the same key and base URL. Use it for a domain already configured with the other required records. A single created record does not establish complete SPF or DKIM setup.

The request bodies and JSON pointers must come from the current public discovery schemas for the two operations. A generic example cannot safely assume the response envelope or the mail verification field name. Set SERVICE_BASE_URL to the service's versioned HTTPS API base, INFRAI_API_KEY to its key, DNS_RECORD_JSON and MAIL_VERIFY_JSON to valid request objects, and DNS_VALUE_POINTER and MAIL_VALUE_POINTER to the corresponding response and request locations. These are local program settings, not API fields. Both pointers address object members; this runner deliberately rejects array traversal.

It requires Go 1.20 or later. Save it as main.go and run it with those environment variables populated. Its output is the verification response, which should be retained with the configuration change record. Verification remains a check: a non-success response ends the run rather than enabling notice dispatch.

package main import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "os" "strconv" "strings" "time" ) func required(name string) string { value := os.Getenv(name) if value == "" { panic("missing " + name) } return value } func object(raw string) map[string]any { var value map[string]any if err := json.Unmarshal([]byte(raw), &value); err != nil { panic(err) } if value == nil { panic("request must be an object") } return value } func locate(root any, pointer string) (map[string]any, string) { if !strings.HasPrefix(pointer, "/") { panic("use a JSON pointer") } parts := strings.Split(pointer[1:], "/") for i := range parts { parts[i] = strings.ReplaceAll(strings.ReplaceAll(parts[i], "~1", "/"), "~0", "~") } for _, part := range parts[:len(parts)-1] { node, ok := root.(map[string]any) if !ok { panic("pointer must traverse objects") } root = node[part] } parent, ok := root.(map[string]any) if !ok { panic("pointer parent must be an object") } return parent, parts[len(parts)-1] } func post(ctx context.Context, base, key, route, token string, body any) []byte { payload, err := json.Marshal(body) if err != nil { panic(err) } client := &http.Client{Timeout: 20 * time.Second} for attempt := 0; attempt < 5; attempt++ { req, err := http.NewRequestWithContext(ctx, http.MethodPost, base+route, bytes.NewReader(payload)) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+key) req.Header.Set("Content-Type", "application/json") req.Header.Set("Idempotency-Key", token) res, err := client.Do(req) if err != nil { panic(err) } data, readErr := io.ReadAll(res.Body) res.Body.Close() if readErr != nil { panic(readErr) } if res.StatusCode >= 200 && res.StatusCode < 300 { return data } if res.StatusCode != http.StatusTooManyRequests { panic(fmt.Sprintf("status %d: %s", res.StatusCode, data)) } if attempt == 4 { panic(fmt.Sprintf("retry budget exhausted: %s", data)) } delay := time.Second * time.Duration(1<<attempt) retryAfter := res.Header.Get("Retry-After") if seconds, err := strconv.Atoi(retryAfter); err == nil && seconds >= 0 { delay = maxDuration(delay, time.Duration(seconds)*time.Second) } else if until, err := http.ParseTime(retryAfter); err == nil { delay = maxDuration(delay, time.Until(until)) } timer := time.NewTimer(delay) select { case <-ctx.Done(): timer.Stop() panic(ctx.Err()) case <-timer.C: } } panic("unreachable") } func maxDuration(a, b time.Duration) time.Duration { if a > b { return a }; return b } func main() { ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) defer cancel() base := strings.TrimRight(required("SERVICE_BASE_URL"), "/") if !strings.HasPrefix(base, "https://") { panic("HTTPS is required") } key := required("INFRAI_API_KEY") change := required("CHANGE_ID") dns := post(ctx, base, key, "/dns/record/create", change+":dns", object(required("DNS_RECORD_JSON"))) var result any if err := json.Unmarshal(dns, &result); err != nil { panic(err) } source, sourceKey := locate(result, required("DNS_VALUE_POINTER")) value, ok := source[sourceKey] if !ok || value == nil { panic("DNS output value is absent") } mail := object(required("MAIL_VERIFY_JSON")) target, targetKey := locate(mail, required("MAIL_VALUE_POINTER")) target[targetKey] = value verified := post(ctx, base, key, "/email/domain/verify", change+":mail", mail) fmt.Println(string(verified)) } 

CHANGE_ID must identify a persisted configuration change, with a different value for a different request payload. Keep it stable across restarts of the same operation. Check each operation's declared idempotency support before relying on that header; an application ledger must prevent duplicate configuration work where server-side deduplication isn't promised. The example retries HTTP 429 with exponential backoff and respects Retry-After. Transport errors stop the run for reconciliation rather than silently repeating a write whose result is unknown.

This handoff is intentionally narrower than a mail sender. It makes the DNS-to-mail dependency visible without inventing send payloads or turning the article into a route catalog.

Give the operator one next action

For LC-155, the runbook begins with the ledger entry. Confirm the notice version and intended recipient. Check the last successful poll, then obtain current email status or events. If the observation is old, repair or resume reconciliation before interpreting its absence as delivery failure. Don't trigger another send just because a polling request was rate limited.

Use a stable application idempotency identity for each notice, recipient, version, and channel. Persist the intent before dispatch and correlate the returned message identifier afterward. A process restart must resume that intent. It must not create a fresh business notification merely because the first worker disappeared between acceptance and persistence. Where the response was lost, reconcile the uncertain attempt before authorizing another write.

SMS fallback needs its own decision record. Persist why fallback was authorized, which email observation informed it, and which SMS message identifier resulted. SMS status tracking, resend, and cancellation can participate in that workflow; cancellation is still an operation to confirm, not evidence that an earlier delivery did not happen. Keep scheduled-email cancellation out of the runbook's assumptions.

Keep this workflow focused on compliance notices sent through email and SMS APIs. If it grows into authentication, don't assume a managed email OTP flow: design that verification lifecycle explicitly. Voice, WhatsApp, and RCS require a different channel choice. Country eligibility checks and country-based SMS abuse cutoffs belong in the business layer, before fallback dispatch; US/EU suitability does not establish domestic China compliance. For audit reporting, retain local spend attribution and template identifiers rather than depending on tag-aggregated cost reports or a template-list operation.

Those boundaries matter more than a short SDK installation.

A new adapter is manageable. An undocumented assumption about what constitutes evidence becomes an operational liability at the worst time.

Budget for false positives before paging

The instrumentation change is to expose evidence age and remaining business deadline alongside poll health, pending retries, and unresolved send intents. These are application metrics to implement, not claimed provider metrics. Page on the combination that requires human action; use a lower-severity signal for a single late observation that can still recover within the allowed window.

A 60-second evidence-age threshold with a 60-second polling interval leaves no useful margin for execution delay. Increase that margin only within the compliance deadline, and test the policy against delayed observations, duplicate results, and worker restarts.

No universal threshold follows from the API contract.

False positives have a delivery cost as well as an on-call cost. If every delayed email observation authorizes SMS, the system produces unnecessary fallback notices and expands the audit trail the next operator must explain. If the threshold is too loose, the first actionable page arrives after the evidence deadline. Choose the integration whose observation model leaves enough room between those two outcomes.

References

These primary sources cover the alternative event mechanisms and the identity standards relevant to the design. DMARC concerns mail authentication policy; it doesn't certify receipt of a logistics notice. Authentication guidance likewise doesn't replace a legal definition of delivery.

Further reading