Choose an SMS alert service by the application work needed to turn a settled payment into one traceable receipt. For a media publisher with US and EU subscribers, settlement handling and delivery observation are the deciding constraints. Passwordless backup alerts can share the transport, but they need their own security policy.
TL;DR: A straightforward SMS integration fits when SMS is the primary channel and the application can own polling and fallback decisions. Compare Twilio, Vonage, and Telnyx against that workload. Add an email receipt alternative when email is an acceptable primary channel. Low cost is a useful procurement goal, but it cannot establish that the integration meets the receipt contract.
This architecture decision record focuses on transaction semantics: which business event creates a receipt obligation, and what evidence permits that obligation to close? It makes integration effort something a backend team can inspect.
Which SMS alert service fits US/EU account notifications and passwordless backup?
Start with the message's authority. A receipt confirms a settled purchase; an account notification reports account activity; a passwordless challenge participates in granting access. Sharing a phone number does not make their expiration and retry rules interchangeable.
Settlement comes first.
For this design, a trusted payment subsystem supplies a stable settlement identifier. A browser redirect is insufficient evidence. Record one receipt obligation per settlement in a durable outbox before contacting the messaging provider. Repeated settlement events must find the same obligation. Keep provider acceptance separate from confirmed delivery, and keep confirmed delivery separate from evidence that a subscriber read anything.
There are three invariants.
No receipt precedes settlement. Replaying the payment event creates no second business obligation. An uncertain send remains uncertain until the application obtains evidence sufficient to choose its next action. The last invariant prevents a particularly awkward edge case: the provider accepts a receipt, the worker times out before recording acceptance, and an eager fallback sends another receipt through a different channel. Both workers may appear locally correct. The subscriber still gets two messages. Local database uniqueness protects the business record, but it does not by itself deduplicate an external send. Where the selected operation documents provider-side idempotency, preserve the same operation identifier across retries; otherwise establish an explicit reconciliation policy before enabling automatic resubmission. Never interpret a new transport attempt as a new purchase.
Keep the receipt spare: publisher identity, a receipt reference, and the minimum information needed to recognize the purchase. Don't slip a promotional offer or a login secret into that template.
Compare the work the publisher must actually own
The table compares decision boundaries, not measured carrier performance. Existing configuration matters: a publisher with an operational sender setup should compare the incremental receipt work against a migration, rather than starting every vendor assessment from an empty account.
| Candidate | Integration decision | Appropriate fit | Boundary to verify |
|---|---|---|---|
| Twilio | Can an existing Twilio adapter and operations runbook be reused? | A publisher already operating Twilio should evaluate incremental work first. | Confirm status meanings and sender requirements for the chosen messaging product and destinations. |
| Vonage | Can the publisher preserve its settlement correlation through its existing Vonage integration? | A team already operating Vonage has a practical reason to evaluate that path. | Verify the selected SMS interface instead of transferring assumptions about another provider's fields. |
| Telnyx | Does the publisher's current Telnyx setup cover the intended receipt workflow? | Include it when existing messaging configuration and operational ownership fit. | Validate destination setup and delivery observation before adopting the adapter. |
| Postmark | Would an email receipt satisfy the product requirement instead? | Evaluate it as an email alternative when SMS is optional. | It is a different channel decision, not evidence that the SMS requirement has been met. |
| Unified REST option | Can a normal HTTP client plus a polling worker satisfy the receipt contract? | A narrow SMS-first workflow with application-owned policy. | Include observation jobs and channel decisions in the effort estimate. |
These differences are conditional on the publisher's actual deployment. They aren't claims that one carrier path is faster or more reliable. The linked documentation gives the team starting points for verifying product behavior; a controlled destination trial must resolve the delivery questions.
Infrai fits the last row through a plain REST API and a unified backend surface: 295 routes across 20 modules with one key, one wallet, one bill. Anything that can issue HTTP requests can call it, with no SDK to install or client-library version to maintain. Sharing that credential and billing boundary with other backend capabilities can reduce the publisher's integration administration. Its public discovery surface supplies request and response schemas for defining the adapter.
The trade-off is application-owned orchestration. This narrow SMS approach is not suitable for a recovery journey that requires coordinated voice, WhatsApp, or RCS fallback; evaluate a broader engagement platform for that requirement.
For this workflow, plan status observation as polling jobs. Keep geographic restrictions, destination spend circuit breakers, and cross-channel fallback policy in application logic. If email joins the flow, budget for application-owned email verification and an HTTP email integration rather than assuming hosted email OTP or SMTP relay. A tightly coordinated journey involving voice or richer messaging deserves a separate platform evaluation.
Observe the critical path without guessing a send payload
The critical path runs from settlement to outbox, then submission, then observation. The code below implements the observation boundary for an existing SMS message identifier. It deliberately does not invent send fields. Both configuration variables are operator inputs: set INFRAI_BASE_URL to the documented v1 API base and INFRAI_API_KEY to the API credential. SMS_MESSAGE_ID comes from an earlier successful submission. Use Python 3.11 or later; no third-party package is required.
import json import os import time from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.parse import quote from urllib.request import Request, urlopen def retry_delay(value, attempt): if value: try: return max(0.0, float(value)) except ValueError: try: when = parsedate_to_datetime(value) if when.tzinfo is None: when = when.replace(tzinfo=timezone.utc) return max( 0.0, (when - datetime.now(timezone.utc)).total_seconds(), ) except (ValueError, TypeError, OverflowError): pass return 2 ** attempt def read_sms_status(): base = os.environ["INFRAI_BASE_URL"].rstrip("/") key = os.environ["INFRAI_API_KEY"] message_id = quote(os.environ["SMS_MESSAGE_ID"], safe="") url = base + "/sms/status/" + message_id for attempt in range(4): request = Request( url, method="GET", headers={ "Authorization": "Bearer " + key, "Accept": "application/json", }, ) try: with urlopen(request, timeout=20) as response: if response.status != 200: raise RuntimeError( f"Unexpected HTTP status: {response.status}" ) return json.load(response) except HTTPError as error: detail = error.read().decode("utf-8", errors="replace") if error.code == 429 and attempt < 3: time.sleep(retry_delay( error.headers.get("Retry-After"), attempt )) continue raise RuntimeError( f"Status lookup failed: HTTP {error.code}: {detail}" ) from error raise RuntimeError("Status lookup did not complete") if __name__ == "__main__": result = read_sms_status() print(json.dumps(result, indent=2)) The example makes at most four attempts, uses an explicit GET, honors Retry-After, and surfaces error bodies. Connection failures propagate to the caller. Because this is a read, it doesn't create a second receipt when retried. The output is raw JSON; map it to business states only after checking the documented response schema.
Do not log the credential.
For a worker, replace the blocking wait with a scheduled retry and persist the next observation time. Keep a distinct unresolved state when evidence is inconclusive. Choose polling cadence from the publisher's visibility requirement; no measured latency here supports promising an instantaneous dashboard.
Keep compliance and deliverability attached to the message purpose
A useful acceptance exercise has four cases: repeated settlement, a rate-limited request, uncertain acceptance after a timeout, and a later failed delivery observation. Each should preserve one business obligation while leaving an operator able to explain the next action.
Deliverability needs context. A promotional opt-out, an invalid destination, and a request to stop one notification purpose should not collapse into a single unexplained suppression flag. Preserve the reason so the receipt policy can make the appropriate decision. A successful HTTP request does not establish permission to message a recipient.
For US/EU deployment, document the legal basis and purpose for each message class. GDPR Article 7 describes conditions for consent where consent is the basis; it does not establish that every transactional receipt requires consent, nor does it settle US sender requirements. Review the actual destinations and sender configuration.
Authentication is stricter.
OWASP's password-reset guidance calls for controls around recovery tokens and brute-force attempts. A receipt's patient retry policy is unsuitable for passwordless access. Enforce the authentication flow's validity and attempt rules independently, even if both workflows share the same HTTP adapter.
Rejected option: one receipt-and-recovery state machine
Reject a single state machine that treats receipt delivery and passwordless recovery as interchangeable send jobs. It makes the first integration look smaller, but pushes incompatible expiration and authorization rules into one ambiguous success state.
A shared transport adapter remains useful. Reuse credential loading, HTTP handling, and observation plumbing while keeping each workflow's authority explicit. A broader engagement platform is a valid alternative when coordinated channel selection is itself the product requirement; an email-first receipt is valid when the subscriber experience permits it. For the media receipt here, require a demonstrated need before adopting either change.
The review artifact is one settled order traced through one obligation, an uncertain send, and a documented outcome. Compare the bills after the team can explain that trace.
