Gate a property report email on current account and suppression state, then use delivery status polling for secondary SMS event notification alerts. A generated attachment is the business requirement; an accepted send request is only one checkpoint toward meeting it. Country guardrails and a per-user rate limit belong before dispatch.

Short answer: keep the report dispatch record in your application, check recipient eligibility before sending, and poll delivery status before deciding whether to resend. Put per-user cooldowns, country allowlists, and spend thresholds ahead of the SMS send. An account lookup must not silently authorize an urgent text.

How should SMS event notification alerts use delivery status polling?

The useful operational signal is a report that is ready while recipient eligibility or delivery state remains unresolved. Hold that dispatch and investigate the state transition, because sending again can create a second message without resolving what happened to the first. For a property manager distributing generated reports as email attachments, the dispatch ledger should connect the report revision, intended recipient, account reference, channel, provider message identifier, and last observed state; these are application-owned fields, not a proposed provider request schema.

Hold the message.

Define an SLO around the fraction of eligible report notifications that obtain delivery evidence within a chosen deadline, and track unknown outcomes separately from explicit failures. A successful API request alone is too weak a success criterion, while a missing observation should not be rewritten as a confirmed delivery failure. Consider a report dispatch whose send was accepted but whose next poll has not finished: its report revision and recipient are unchanged, its provider identifier is already known, and another send would introduce a new delivery attempt before the first one has been reconciled. Preserve that identifier, schedule another observation within the polling budget, and leave the business state unresolved. If a later observation establishes a recoverable failure, the worker can evaluate a resend against current suppression and cooldown rules; if it establishes delivery, the ledger can close the notification without another send. This is a proposed state-machine policy, not a claim about measured provider outcomes.

Choose the deadline with the business owner.

Capacity planning starts with the outstanding population. As a hypothetical planning example, polling 600 unresolved messages once every 30 seconds requires approximately 20 status requests per second before retries, account checks, or sends. These are workload assumptions, not a provider throughput claim. Increase the interval or reduce the active polling population when the application budget cannot support that load, and make the resulting detection delay visible in the SLO rather than hiding it in a worker setting.

The same distinction matters for fitness class waitlists: an SMS event notification about a seat opening does not prove that the recipient accepted the offer. A property report likewise needs separate document state and notification evidence. Moving either workflow from a Node.js worker to Go would not change that contract.

Buy the transport, build the admission gate

Infrai combines a self-describing REST API with one key, one wallet, and one bill across account access, email, and SMS, so public discovery supplies the schemas and runnable examples needed to inspect a capability without learning another SDK while unified billing and a single API key reduce credential and invoice handoffs. The same credential covers account lookup, welcome email, and SMS fallback; the wider surface has 295 routes across 20 modules. The combined choice means one vendor to trust and one outage surface.

Consolidation does not replace application policy.

A suppression result is scoped evidence to interpret, not permission to assume that every channel shares the same recipient state. Keep the decision to send a welcome email, a report email, or an SMS fallback explicit, and recheck eligibility when a queued dispatch actually runs.

Buy-vs-build choice Useful boundary Limitation and application work
Clerk + Resend + Twilio Separately selected account, email, and SMS components Three integrations need recipient mapping and suppression reconciliation
Resend as the email component Fits a decision to select email independently from account and SMS services The email choice alone does not define cross-channel fallback policy
Twilio as the SMS component Fits a decision to select SMS independently from report email The SMS choice alone does not establish report attachment readiness
SendGrid as an alternative email component Another candidate when evaluating the email transport separately Evaluate the email contract; retain application-owned account and SMS coordination
Combined API across the three capabilities Fits a team prioritizing one credential boundary Less independent vendor selection; retain cross-channel policy and reconciliation
Build the orchestration while buying transport Direct ownership of the admission state machine Worker capacity, durable transitions, retry policy, and on-call procedures remain yours

The Clerk + Resend + Twilio alternative means three service signups and three sets of credentials, with glue to map account identifiers to email addresses and phone numbers and reconcile suppression decisions across them. These are legitimate boundaries when a team wants to select or replace each component separately. They also create integration work that a roadmap needs to acknowledge. This comparison concerns those boundaries; it does not establish that one provider has better delivery rates than another.

A combined provider is not a good fit when independent component ownership is the decisive requirement. Conversely, separate providers impose coordination overhead that a small platform team may prefer to avoid. Neither choice removes the need to prove that a generated report can be attached using the selected email capability's actual schema; do not guess attachment fields from another provider's SDK.

Implement the account-to-email handoff before sending

This Go program is an executable preflight: account lookup followed by an email suppression lookup. The first response supplies the address used in the second request, while both requests use the same key and base URL. It does not send a report or authorize a fallback, which keeps the handoff inspectable without fabricating an account response field or an attachment payload.

Save the discovery documents for account-get and email-suppression-check as two trusted local JSON files. Supply their filenames, the account identifier, and the JSON Pointer to the email string in the account response as the program's four arguments. Select that pointer from the response schema, including any envelope. Set API_BASE_URL to the documented versioned API base and INFRAI_API_KEY to your key. Save the program as main.go and run it with Go, passing those four arguments. It reads each HTTP method and path from discovery and requires GET; each selected capability must have exactly one path parameter.

package main import ( "encoding/json" "fmt" "io" "net/http" "net/url" "os" "strconv" "strings" "time" ) type capability struct { Method string `json:"method"` Path string `json:"path"` } func load(name string) capability { data, err := os.ReadFile(name) if err != nil { panic(err) } var c capability if err := json.Unmarshal(data, &c); err != nil { panic(err) } if c.Method != http.MethodGet { panic("preflight requires GET") } return c } func get(c capability, value string) ([]byte, error) { base := strings.TrimRight(os.Getenv("API_BASE_URL"), "/") key := os.Getenv("INFRAI_API_KEY") parsed, err := url.Parse(base) if err != nil || parsed.Scheme != "https" || parsed.Host == "" || !strings.HasSuffix(base, "/v1") || key == "" { return nil, fmt.Errorf("set an HTTPS versioned API_BASE_URL and INFRAI_API_KEY") } start, end := strings.Index(c.Path, "{"), strings.Index(c.Path, "}") if start < 0 || end <= start || !strings.HasPrefix(c.Path, "/v1/") { return nil, fmt.Errorf("expected a versioned path with one parameter") } path := c.Path[:start] + url.PathEscape(value) + c.Path[end+1:] if strings.ContainsAny(path, "{}") { return nil, fmt.Errorf("unexpected extra path parameter") } client := &http.Client{ Timeout: 15 * time.Second, CheckRedirect: func(_ *http.Request, _ []*http.Request) error { return http.ErrUseLastResponse }, } for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequest(c.Method, base+strings.TrimPrefix(path, "/v1"), nil) if err != nil { return nil, err } req.Header.Set("Authorization", "Bearer "+key) res, err := client.Do(req) if err != nil { return nil, err } data, readErr := io.ReadAll(res.Body) res.Body.Close() if readErr != nil { return nil, readErr } if res.StatusCode == http.StatusTooManyRequests && attempt < 3 { delay := time.Second * time.Duration(1<<attempt) hint := res.Header.Get("Retry-After") if seconds, err := strconv.Atoi(hint); err == nil && seconds >= 0 { if wait := time.Duration(seconds) * time.Second; wait > delay { delay = wait } } else if until, err := http.ParseTime(hint); err == nil { if wait := time.Until(until); wait > delay { delay = wait } } time.Sleep(delay) continue } if res.StatusCode < 200 || res.StatusCode >= 300 { return nil, fmt.Errorf("HTTP %d: %s", res.StatusCode, data) } return data, nil } return nil, fmt.Errorf("retry budget exhausted") } func selectString(data []byte, pointer string) (string, error) { var node any if err := json.Unmarshal(data, &node); err != nil { return "", err } if !strings.HasPrefix(pointer, "/") { return "", fmt.Errorf("expected JSON Pointer") } for _, token := range strings.Split(pointer[1:], "/") { token = strings.ReplaceAll(strings.ReplaceAll(token, "~1", "/"), "~0", "~") obj, ok := node.(map[string]any) if !ok { return "", fmt.Errorf("pointer must traverse object fields") } node, ok = obj[token] if !ok { return "", fmt.Errorf("pointer field missing") } } value, ok := node.(string) if !ok || value == "" { return "", fmt.Errorf("expected nonempty email string") } return value, nil } func main() { if len(os.Args) != 5 { panic("arguments: account-discovery.json suppression-discovery.json account-id email-pointer") } account, err := get(load(os.Args[1]), os.Args[3]) if err != nil { panic(err) } address, err := selectString(account, os.Args[4]) if err != nil { panic(err) } suppression, err := get(load(os.Args[2]), address) if err != nil { panic(err) } if !json.Valid(suppression) { panic("expected a JSON suppression response") } fmt.Println(string(suppression)) } 

Interpret the printed suppression response against its schema before admitting the email. An empty address, missing field, timeout, or unsuccessful status stops this preflight; none should fall through to sending. Avoid copying recipient responses into shared logs. This program has no writes, so its bounded rate-limit retries cannot create duplicate dispatches.

For the actual send worker, bind a client idempotency key to the logical report dispatch and reuse it for retries of that same operation. Check the selected capability's idempotency declaration before relying on deduplication, and keep a durable application record as well: a platform convention with a default 24-hour deduplication window is not a permanent business ledger. A later report revision needs its own dispatch identity.

Reconcile delivery before you resend or cancel

Treat sent, delivered, failed, and undeliverable as observations to reconcile with the dispatch record. Delivery events in this integration are pulled, so the worker must schedule status and event checks. Keep the polling backlog and oldest unresolved dispatch visible.

An idle sender can still have unresolved deliveries.

For an SMS fallback, use short, deterministic copy and admit only allowed destinations. A US-only policy needs a different allowlist from a policy admitting selected EU countries; define the destinations explicitly rather than treating “EU” as a single routing decision. Check per-user cooldown, suppression, and the application spend threshold before each send or recoverable resend. Keep your own business metadata and cost ledger so a threshold can be evaluated without depending on a tag-aggregation report.

A resend is appropriate only after a recoverable failure and a fresh policy check. It isn't the next step merely because polling has not yet observed delivery. Cancel only a pending scheduled SMS when the product permits withdrawal, and don't promise that cancellation retracts an already dispatched message. For report email, make withdrawal an application admission decision before dispatch instead of offering an assumed transport cancellation. If inbound STOP or help handling is part of the product, poll inbound messages and carry opt-outs into suppression logic before admitting another notification.

Verify the gate, then define rollback

Before enabling report distribution, verify three distinct outcomes with controlled recipients: an eligible account reaches the suppression check, a suppressed recipient never reaches the send worker, and an unresolved lookup leaves the dispatch on hold. Inspect actual responses against discovery schemas. For the attachment requirement, verify the selected email request contract and inspect the received document; the preflight proves neither attachment support nor delivery by itself. Google's sender guidelines also belong in the email readiness review, independently of which API supplies the transport.

Then verify the operational boundary: rate-limited lookups back off, retry exhaustion remains visible, polling load fits the planned budget, and unknown SMS outcomes do not authorize automatic resends. Keep test expectations separate from measured production results. No uptime or latency benchmark is implied here.

Rollback should pause new dispatch admission and automatic SMS fallback while preserving existing message identifiers and continuing reconciliation. Otherwise the team loses the evidence needed to decide what is safe to resume. Reopen admission only after recipient policy, report revision, and outstanding delivery state can be reconciled; clearing the queue and sending everything again is a poor recovery rule for a property report that may already be in someone's inbox.

References