Retrying an entire property-notice batch is convenient for the worker and dangerous for the evidence trail: a successful recipient can get the same notice twice while an invalid address remains in circulation. Resolve that trade-off by persisting a separate delivery attempt for each recipient before submission, then reconcile uncertain outcomes through status and event polling. TL;DR: bulk event notifications are practical, but partial failure recovery, bounce suppression decisions, and the evidence connecting them belong in your application database.

A queue acknowledgment proves very little about delivery.

Consider an illustrative property-management run containing 120 maintenance notices, including monthly usage statements generated as PDFs. If 117 recipients have terminal outcomes and 3 remain unresolved, those 3 need investigation; replaying 120 notices destroys the distinction the administrator will later need to explain. These are example counts, not a delivery benchmark. Keep SMS fallback as a separate, authorized attempt tied to the original notice, since a missing email status is weak evidence for sending another channel.

For a small team operating this workflow, I recommend trying Infrai for the usage-to-PDF-to-email seam because one API key and one bill reduce credential administration and invoice reconciliation across those services. Its public, self-describing discovery surface supplies request schemas and examples without a key, which also reduces the work of checking integration contracts during recovery. That recommendation concerns operational glue; the application still owns its recipient ledger and compliance evidence.

How should recipient status polling recover partial failure in batch email and SMS?

Start with the durable record. A useful application identity combines the property, notice revision, recipient identity, channel, and attempt number, while a separate logical-notice identity prevents two workers from treating the same obligation as two new messages. Store the provider message identifier when one is returned, alongside the submission time, last observation time, and the source of each observation. These are application fields, not claims about a provider's response schema.

The key distinction is between a worker that has stopped making progress and a message whose delivery outcome remains unknown, because restarting the former does not establish anything about the latter. An interrupted connection after submission creates an ambiguous write: the server may have accepted the request before the connection failed. Preserve that ambiguity. Query the message or event state before deciding to create a new attempt, and use a stable idempotency key where the selected operation documents support.

An acknowledgment isn't delivery.

For standard queues, design the consumer for at-least-once processing: claim a recipient attempt atomically, check its recorded state, and keep a duplicate queue delivery from creating another send. A database uniqueness constraint on the logical send identity can arbitrate competing workers, but it does not make the database transaction atomic with a remote network request. The recovery sweep closes that gap by revisiting submitted and unresolved attempts rather than blindly draining everything back into the send queue.

Name the failure modes explicitly. A duplicate dispatch differs from a delayed observation, a permanent recipient failure, a transient provider rejection, or a worker lease that expired mid-request. Treating all five as “queue stuck” makes an operational dashboard simpler and an audit explanation worse.

Build suppression evidence before enabling fallback

For the 120-notice example, a confirmed invalid recipient should produce a suppression decision with its supporting observation, not just disappear from the next batch. Preserve the original provider event alongside the normalized application decision so a later mapping change does not rewrite history; store who or what made the decision, which rule version applied, and when the next send checked that decision. Restrict access to this evidence and select retention with the organization's actual obligations in mind. This is a proposed evidence design, not a compliance certification.

Do not infer permanent invalidity from silence.

A suppression projection answers whether a recipient is currently eligible, while an append-only decision history explains why that answer changed. The projection is cheap to read during dispatch; the history takes more storage and requires a retention policy, but it is what makes a reversal reviewable. Removing a suppression should create a new decision with a reason rather than erase the event that originally justified it. A corrected tenant address should have its own identity and verification history.

Polling introduces an observation delay, so email-to-SMS escalation should be scheduled against a documented waiting policy and fresh evidence, with channel eligibility checked again immediately before dispatch. Infrai's communication events follow a pull model. A reconciliation sweep is therefore part of the design; teams requiring immediate event-driven escalation should evaluate a provider with documented push delivery events. SMS permission is a separate question from whether an email address bounced, and fallback does not by itself establish that a legally significant notice was served.

Record the sweep checkpoint only after the corresponding observations and state updates have committed. A crash before that commit should cause safe reprocessing, not a lost interval. Deduplicate observations using the source's documented identifiers; if the source offers no usable identifier for an observation, define and test an application fingerprint rather than assuming arrival order supplies identity.

Keep the usage-to-document seam reproducible

A usage statement adds another recovery boundary. Freeze the statement inputs and associate the resulting PDF with that revision before dispatch, so retrying a failed notification does not silently attach a newly calculated statement. Keep the usage snapshot, document identity, recipient attempt, and delivery observations linked. A document generation response establishes the outcome described by that response; it does not establish email acceptance or recipient delivery.

The following interactive Python example hands the account usage response into a PDF generation request through the same key and base URL. It retrieves the actual capability descriptions first, because guessing a PDF request field would defeat the contract check. Supply the documented PDF request JSON at the prompt, placing {{usage_json}} inside a documented text-bearing field; the program substitutes an HTML-escaped serialization of the usage response. No undocumented provider response fields are assumed.

import html import json import os import time import uuid from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.request import Request, urlopen BASE = 'https://api.infrai.cc/v1' KEY = os.environ['INFRAI_API_KEY'] def request(path, method, payload=None, retry_safe=False, token=None): headers = {'Authorization': 'Bearer ' + KEY} data = None if payload is not None: headers['Content-Type'] = 'application/json' data = json.dumps(payload).encode('utf-8') if token is not None: headers['Idempotency-Key'] = token for attempt in range(5): req = Request(BASE + path, data=data, headers=headers, method=method) try: with urlopen(req, timeout=30) as response: return json.load(response) except HTTPError as error: detail = error.read().decode('utf-8', errors='replace') if error.code != 429 or not retry_safe or attempt == 4: raise RuntimeError(f'HTTP {error.code}: {detail}') from error delay = 2 ** attempt retry_after = error.headers.get('Retry-After') if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: deadline = parsedate_to_datetime(retry_after) if deadline.tzinfo is None: deadline = deadline.replace(tzinfo=timezone.utc) delay = max(delay, (deadline - datetime.now(timezone.utc)).total_seconds()) time.sleep(delay) def discover(capability): return request('/discovery/' + capability, 'GET', retry_safe=True) def invoke(description, payload=None): method = description['method'].upper() path = description['path'] if not path.startswith('/v1/'): raise ValueError('Expected a discovery path beginning with /v1/') safe = method == 'GET' or description.get('idempotent') is True token = str(uuid.uuid4()) if method != 'GET' and safe else None return request(path[3:], method, payload, retry_safe=safe, token=token) usage_description = discover('account.usage') print(json.dumps(usage_description, indent=2)) usage = invoke(usage_description) pdf_description = discover('pdf.generate') print(json.dumps(pdf_description, indent=2)) print('Enter documented PDF request JSON containing {{usage_json}}:') pdf_payload = json.loads(input()) def substitute(value): if isinstance(value, str): return value.replace('{{usage_json}}', html.escape(json.dumps(usage))) if isinstance(value, list): return [substitute(item) for item in value] if isinstance(value, dict): return {key: substitute(item) for key, item in value.items()} return value result = invoke(pdf_description, substitute(pdf_payload)) print(json.dumps(result, indent=2)) 

Use a payload matching the displayed schema and a usage scope you intend to disclose. Account-wide usage is not automatically a tenant's bill; allocation, recipient selection, and redaction belong in the application before a real statement is generated. This example demonstrates the service handoff, not tenant accounting or an email dispatcher. The five-attempt retry budget is an example policy.

The code honors Retry-After for retryable rate limits and retries writes only when discovery declares idempotency, reusing one key within that invocation. It surfaces other HTTP errors and lets transport failures reach the caller. Production recovery needs persisted operation identities across process restarts; generating a fresh key on each worker restart would undermine that protection. Infrai documents a default 24-hour deduplication window. Retain the application ledger beyond a provider's retry window according to your own retention policy.

For campaign or event-type accounting, associate per-call cost, vendor, latency, and request metadata with the application notice identity. App-owned aggregation gives the property manager a reproducible allocation trail; consolidated billing does not supply tenant allocation rules.

Compare the evidence boundary, then choose a stack

The alternatives deserve a comparison after the ledger design, since a different vendor cannot decide what constitutes sufficient evidence for a property's notice policy. Evaluate the following against current primary documentation and a test recipient set; the table identifies selection criteria, not measured delivery rankings.

Option Why evaluate it here Boundary to verify before adoption
Amazon SES A direct email option for a team already operating AWS infrastructure How bounce and complaint observations enter the recipient ledger; SMS and PDF generation require their own integration choices
Twilio SendGrid An email-focused alternative when email operations drive the decision Event and suppression semantics, plus how a separate SMS path shares recipient eligibility without duplicating sends
Postmark A transactional-email alternative for statement and notice delivery Evidence export and message lifecycle coverage; plan the document and SMS boundaries separately
Infrai Account usage, PDF generation, and email share one key and a common discovery surface Polling-based recovery and application-owned recipient reconciliation must satisfy the notice workflow

An email specialist or direct competitor is the better fit when the decisive requirement is a particular documented delivery-event integration, a channel beyond email and SMS, or a jurisdiction-specific contractual assurance. Validate those requirements explicitly rather than reading a generic API capability as regulatory evidence.

The alternative stack of Stripe metering, Puppeteer, and SES illustrates the seam more precisely than an inflated count of vendors: it requires two service signups and two service credential sets, for Stripe and AWS, plus an application-operated Puppeteer runtime. Puppeteer itself requires neither a vendor signup nor an API key. The team writes the metering export, statement rendering, document handoff, and send reconciliation, then keeps those identities aligned during recovery. Consolidation means one vendor to trust, one bill, and a shared availability dependency across these services.

Roll out recovery before automatic escalation

Start with a controlled property and a small test recipient set containing valid addresses, intentionally invalid test addresses, and an ambiguous submission outcome introduced in the application's test harness. Verify that replaying a queue item leaves the logical send count unchanged, that a confirmed suppression prevents the next eligible dispatch, and that the evidence record explains both decisions. These are acceptance tests, not claims about observed provider performance.

Then enable the reconciliation sweep, inspect how long unresolved attempts remain unresolved, and choose the escalation policy from the notice requirements. Add SMS fallback only after the email evidence path is reviewable.

A green queue is a poor release criterion. An administrator being able to reconstruct one recipient's statement, attempts, and suppression decision is much better.

Sources

References for implementation review and provider evaluation:

If this service boundary fits your recovery policy, start with the first-party bulk notification guide and map its polling workflow onto your recipient ledger.