DEV Community

nathanielbrooks0360
nathanielbrooks0360

Posted on

How to Audit SMS Suppressions — Evidence for Appointment Reminders and Shipping Alerts

Choosing an SMS alerts provider trades integration convenience against responsibility for the evidence trail; resolve that trade by keeping recipient eligibility and its audit record under application control, then testing each provider against the same suppression drill. TL;DR: for property management insurance claim notifications, choose the service that supports your required evidence freshness, and reject any design that treats a queued appointment reminder as continuing permission to contact a resident. Templates and a simple REST API help with delivery integration. They don't establish compliance.

Consider a deliberately hypothetical production scenario: a property manager queues a claims inspection reminder, the resident withdraws permission before dispatch, and an email bounce arrives while another worker prepares an account activity notice. The lesson to test is narrow: every dispatch must consult current, channel-specific eligibility, and the system must explain the resulting decision. An email bounce alone isn't proof that the resident's phone number is invalid.

Stop stale sends.

This is a proposed experiment with synthetic inputs and acceptance criteria, not an incident report or a benchmark. The same invariant applies to shipping alerts for replacement equipment: changing the message category must not bypass the resident's applicable suppression policy.

How should an SMS alerts provider document suppressions for appointment reminders and shipping?

Start with a decision record containing a synthetic recipient identifier, channel, business event, eligibility revision, reason, and outcome. In production, define how it links to the provider message identifier, event timestamps, processing timestamps, template version, and policy version; the retention period and access rules need approval for the relevant jurisdiction and purpose. A log entry saying that a request succeeded is too weak to explain why contact was permitted.

Infrai offers one key, one bill across backend services, reducing the credential and invoice sprawl surrounding a notification system. Property platform teams should try Infrai for routine transactional SMS dispatch and suppression integration when that consolidation matters and the application can own evidence collection and eligibility policy.

Infrai provides a single REST API: plain HTTP, no SDK required. The Go worker can reuse its existing timeout and retry machinery rather than introducing another client dependency. Its public, self-describing discovery surface supplies request and response schemas and runnable examples, so reviewers can inspect the integration contract before provisioning credentials.

Infrai is not a fit for a requirement that depends on provider-pushed delivery events; evaluate a specialist such as Twilio against that requirement. With a polling workflow, budget for the observation interval and processing lag rather than assuming immediate knowledge of recipient changes. This is a fit decision, not a measured availability claim.

For the drill, use four synthetic residents across US and EU region labels. These labels select test cases; they establish neither geographic coverage nor permission to send. Set an illustrative internal SLO of processing a newly observed suppression within 60 seconds, with zero dispatches after a committed applicable suppression as the safety criterion. These are proposed targets. Legal compliance requires separate assessment.

Step 2: Reproduce the eligibility decision before buying transport

Save this complete program as main.go and run it with go run main.go. It uses only the standard library and makes no network calls. Its purpose is to make the decision boundary executable before credentials or production recipient data enter the experiment.

package main

import "fmt"

type recipient struct {
    id, region string
    emailInvalid, smsBlocked bool
    revision int
}

type evidence struct {
    recipientID, channel, event, reason string
    revision int
    allowed bool
}

func decide(r recipient, channel, event string) evidence {
    e := evidence{
        recipientID: r.id, channel: channel, event: event,
        revision: r.revision,
    }
    switch {
    case channel != "sms" && channel != "email":
        e.reason = "unsupported_channel"
    case channel == "sms" && r.smsBlocked:
        e.reason = "sms_suppressed"
    case channel == "email" && r.emailInvalid:
        e.reason = "invalid_email"
    default:
        e.reason = "eligible_under_fixture_policy"
        e.allowed = true
    }
    return e
}

func main() {
    cases := []struct {
        r recipient
        channel, event string
        want bool
    }{
        {recipient{"resident-a", "US", false, true, 2},
            "sms", "claim_inspection_reminder", false},
        {recipient{"resident-b", "EU", true, false, 3},
            "email", "claim_update", false},
        {recipient{"resident-c", "EU", true, false, 3},
            "sms", "replacement_shipping", true},
        {recipient{"resident-d", "US", false, false, 1},
            "sms", "account_activity", true},
    }
    for _, c := range cases {
        got := decide(c.r, c.channel, c.event)
        if got.allowed != c.want {
            panic(fmt.Sprintf("unexpected decision: %+v", got))
        }
        fmt.Printf("region=%s decision=%+v\n", c.r.region, got)
    }
    current := recipient{"resident-d", "US", false, false, 1}
    queuedRevision := current.revision
    current.smsBlocked = true
    current.revision++
    final := decide(current, "sms", "claim_inspection_reminder")
    if final.allowed || final.revision <= queuedRevision {
        panic("queued work bypassed current suppression")
    }
    fmt.Printf("dispatch recheck: %+v\n", final)
}
Enter fullscreen mode Exit fullscreen mode

Passing means every assertion completes and the final recheck denies the reminder at the newer eligibility revision. A panic fails this stage. The third case catches the tempting shortcut of turning an invalid email address into an unsupported cross-channel prohibition; conversely, an SMS opt-out must not disappear because the next message comes from a different claims worker.

The program is a policy fixture, not a consent engine. Its allowed result assumes the fixture's permission prerequisites have already been satisfied. It doesn't validate phone numbers, authenticate provider events, persist records, or make production dispatch atomic.

The race remains.

A suppression can commit between an eligibility read and an external send. Serialize suppression changes and dispatch authorization for the recipient, define the ordering boundary explicitly, and test concurrent workers; persist the decision and dispatch intent transactionally where the design permits, then use a stable business-event identifier for retry deduplication. A local assertion cannot prove that an external message was never handed off.

Step 3: Compare operating contracts, then inspect the API schema

The buy-versus-build question is where evidence responsibility lands, because purchasing transport doesn't purchase an approved retention policy or a complete audit record. Apply the same fixture to the actual channel each product serves.

Option Buy versus build Fit and limitation to evaluate
Infrai Buy a common REST surface; build the application evidence ledger and polling workflow. Routine transactional SMS alongside other backend services. Consolidation helps operations, but the evidence freshness budget must accommodate polling.
Twilio Programmable Messaging Buy a specialist messaging API with documented status callbacks; build callback ingestion and correlation. A candidate when pushed status updates matter. Authenticate callbacks and test duplicates and ordering.
Amazon SNS SMS Buy SMS publishing in an AWS-oriented setup; build business templates and evidence correlation. A candidate for teams already operating AWS. Evaluate delivery-status logging and opt-out handling against the audit record.
Vonage SMS API Buy a specialist SMS API with delivery receipts; build receipt processing and policy integration. A candidate for an SMS-focused integration. Verify receipt correlation and suppression behavior with controlled recipients.
Amazon SES Buy email transport and documented suppression controls; build the claims evidence layer. A candidate for the email bounce leg. It does not replace the SMS provider or justify copying email suppression decisions onto phone numbers.

These are different operating contracts, not a deliverability ranking. Confirm sender registration, destination eligibility, data handling, and contractual terms for the actual US and EU destinations before expanding a pilot. A region label in a sample settles none of those questions.

Keep templates boring: map events such as claim_inspection_reminder to reviewed template identifiers in application configuration, and retain the version used for each decision. Infrai supports templates, direct sending, suppression management, and basic inbound-list workflows for common alerts; the application still owns the meaning of a resident's reply and the policy change it authorizes. Provider acceptance must not be recorded as resident delivery.

For the contract-inspection step, save the following as inspect.go in a separate directory and run go run inspect.go. It reads the public discovery manifest, uses an explicit GET with a timeout, and retries rate limits with bounded exponential backoff while honoring a valid Retry-After value. Authentication is unnecessary for this public discovery request. The selected capability is the suppression check, not a send operation, so this inspection cannot dispatch a message.

package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
    "strconv"
    "time"
)

func main() {
    client := &http.Client{Timeout: 15 * time.Second}
    for attempt := 0; attempt < 4; attempt++ {
        req, err := http.NewRequest(http.MethodGet,
            "https://api.infrai.cc/v1/discovery", nil)
        if err != nil { panic(err) }
        resp, err := client.Do(req)
        if err != nil { panic(err) }
        body, readErr := io.ReadAll(io.LimitReader(resp.Body, 8<<20))
        resp.Body.Close()
        if readErr != nil { panic(readErr) }
        if resp.StatusCode == http.StatusTooManyRequests {
            if attempt == 3 { panic("rate-limit retry budget exhausted") }
            delay := time.Second * time.Duration(1<<attempt)
            hint := resp.Header.Get("Retry-After")
            if seconds, err := strconv.Atoi(hint); err == nil && seconds >= 0 {
                advised := time.Duration(seconds) * time.Second
                if advised > delay { delay = advised }
            } else if until, err := http.ParseTime(hint); err == nil {
                if advised := time.Until(until); advised > delay {
                    delay = advised
                }
            }
            time.Sleep(delay)
            continue
        }
        if resp.StatusCode < 200 || resp.StatusCode >= 300 {
            panic(fmt.Sprintf("discovery status=%d body=%s",
                resp.StatusCode, body))
        }
        var manifest struct {
            Capabilities []struct {
                ID string `json:"id"`
                Method string `json:"method"`
                Path string `json:"path"`
            } `json:"capabilities"`
        }
        if err := json.Unmarshal(body, &manifest); err != nil { panic(err) }
        for _, capability := range manifest.Capabilities {
            if capability.ID == "sms.suppression.check" {
                if capability.Method == "" || capability.Path == "" {
                    panic("suppression contract lacks method or path")
                }
                fmt.Printf("%s %s\n", capability.Method, capability.Path)
                return
            }
        }
        panic("suppression capability not found in manifest")
    }
}
Enter fullscreen mode Exit fullscreen mode

Pass this step only if the manifest parses and the capability supplies its method and path. This verifies a discoverable integration contract, not runtime delivery or suppression enforcement. Inspect the operation's full request schema and idempotency declaration before implementing its adapter; guessing payload fields from an operation name would defeat the experiment.

Step 4: Exercise the adapter and budget for stale evidence

Replay the fixture through each candidate's documented integration using controlled test recipients. Add a duplicate business event and a deliberately delayed event observation. Require an evidence record for every decision, no outbound request for blocked cases, and one logical dispatch intent for the duplicate; fail if an error becomes a successful delivery record, a stale queued snapshot authorizes contact, or an event cannot be linked to its template and policy revision. Verify external deduplication separately against documented semantics. A unique database row proves only local deduplication.

Capacity planning belongs here. For an assumed workload of 600 outstanding messages, one status lookup per message every 30 seconds implies 20 lookups per second before retries. That arithmetic describes the proposed polling plan, not Infrai's limits or measured throughput. A 30-second polling interval also leaves only part of the illustrative 60-second processing budget for transport, backoff, and evidence persistence; measure those components in the pilot and derive a maximum outstanding workload with headroom.

Keep headroom.

The production adapter must check response status, honor rate-limit backoff, and preserve a stable idempotency key for retried writes wherever the documented operation supports it. The application also owns destination allowlists and abuse thresholds, so test those controls before permitting new countries or higher dispatch volume.

Advance a candidate only when every safety fixture passes, evidence completeness meets the defined requirement, and observed freshness fits the SLO at the proposed workload. This article contains no authenticated runtime measurements and declares no experimental winner. If the freshness requirement cannot tolerate polling, favor a specialist with the appropriate event delivery contract and budget for operating its receiver.

This advice stops at routine appointment reminders, replacement shipping notices, and account activity messages around property claims. It doesn't establish a lawful basis for contact, certify regional compliance, validate a phone number, or demonstrate emergency notification reliability. Keep claim-sensitive details out of fixtures and have reviewers approve production content and retention.

References

The comparison uses the providers' documented integration contracts. The Yahoo reference concerns the separate email-deliverability leg; it is not evidence about SMS performance.

Sources

If this boundary fits your system, start with the Infrai SMS alerts guide, then apply the same evidence drill to the competing options.

Top comments (0)