Payment settlement fixes what a receipt must say; a later template edit must not quietly change that record. TL;DR: choose an email provider by where the receipt template lives, who approves a revision, and whether you can reproduce the rendered receipt after a retry. Compare Postmark, Resend, SendGrid, and Amazon SES on that boundary, then evaluate an SMS provider separately. Custom-domain DKIM and a successful send response don't settle the ownership question.
For a production design review, I would bound the scenario this way: an e-commerce payment has settled, its receipt is waiting to send, and someone changes the shared template before the worker retries. This is a hypothetical failure scenario, not a reported incident. The operational question is concrete: does that order receive the approved receipt, or whatever happens to be published when the worker wakes up? An infrastructure lead needs an answer that survives both an editor's release and a worker restart, without making the platform team the permanent gatekeeper for every copy change.
Freeze the artifact.
The invariant is that one settled payment selects one approved template revision and one set of receipt values. Transport can retry; the receipt's meaning must remain stable. That puts template ownership ahead of a cheapest-provider ranking, particularly when a US/EU storefront wants branded email and optional SMS alerts but has only one team carrying the notification on-call load.
How should a provider handle custom-domain product event notifications and SMS?
Start with a buy-vs-build decision, before choosing a delivery contract. Provider-hosted templates can move editing work out of application deployments, but the evaluation must establish revision selection and approval ownership. Application-owned rendering puts those decisions in your release process, at the cost of maintaining the renderer and an editing workflow. Neither arrangement relieves the merchant of responsibility for receipt contents.
Use the same settled-order example in each evaluation. Ask an editor to change the footer, retry the original receipt, and compare the output with the original artifact. This is an acceptance exercise, not a deliverability benchmark.
| Option | Buy-vs-build boundary to evaluate | Selection condition and limit |
|---|---|---|
| Postmark | Evaluate its email template workflow against application-owned rendering. | Shortlist it for the email side if the approval and replay exercise passes; make SMS a separate decision. |
| Resend | Evaluate how your application rendering workflow and the email service divide responsibility. | Shortlist it if the people who own receipt code can also own its releases; require evidence for any editor workflow you need. |
| SendGrid | Evaluate its template workflow with the same revision and retry exercise. | Shortlist it if that workflow fits your editors; don't infer immutable receipt history from a template editor alone. |
| Amazon SES | Evaluate the email delivery boundary within an AWS-oriented operating model. | Shortlist it if your team accepts the integration and operating responsibilities; inventory them explicitly before committing. |
| Twilio SMS | Evaluate SMS as a separate notification path, using its SMS documentation. | Shortlist it for the SMS assessment; a text alert doesn't prove the receipt email arrived. |
| Application-owned rendering | Build the revision policy, artifact retention, and approval process yourself. | Choose this when reproducible receipt content outweighs the burden of maintaining that process. |
These are selection conditions, not claims that one service wins an unmeasured inbox-placement contest. The official documentation below is a starting point for each evaluation; the final evidence should be a reproducible trial with your sending domain and approved receipt.
Infrai offers one key and one REST API for email, SMS, and other backend services, with no SDK required; its breadth behind a simple interface is useful when a receipt workflow needs another capability without another integration. Its public, self-describing discovery surface supplies request and response schemas without a key, which lets a Go team inspect the receipt adapter's contract before implementation; custom-domain verification, DKIM rotation, and suppression management for both channels also fit branded receipt delivery. The trade-off is API-based sending rather than SMTP relay and pull-based event tracking: the application team owns more integration and observation work, so weigh that contract breadth against an email-focused provider's workflow rather than assume fewer integrations means less operational work.
For this US/EU assessment, treat regional processing, retention, and contractual requirements as procurement checks. A sending-domain setting doesn't answer them. Keep China-specific compliance claims outside this recommendation.
Step 1: Freeze the approved receipt before delivery
Put the ownership decision into an executable acceptance case. The Go program below renders a deliberately small receipt from a settled-payment event, records the selected application template revision, and emits an artifact containing the exact HTML and its digest. Save it as main.go and run it with go run main.go; it uses only the standard library.
The order ID and amount are illustrative inputs, not merchant measurements. The output is local and sends no email or SMS.
package main import ( "bytes" "crypto/sha256" "encoding/json" "fmt" "html/template" "os" ) type Payment struct { EventID string OrderID string Status string AmountText string Currency string } type Artifact struct { EventID string OrderID string TemplateRevision string HTML string SHA256 string } func freeze(p Payment) (Artifact, error) { if p.Status != "settled" { return Artifact{}, fmt.Errorf("payment must be settled") } if p.EventID == "" || p.OrderID == "" || p.AmountText == "" || p.Currency == "" { return Artifact{}, fmt.Errorf("receipt values are required") } const revision = "receipt-v1" const source = "<h1>Receipt {{.OrderID}}</h1>" + "<p>Payment settled: {{.AmountText}} {{.Currency}}</p>" t, err := template.New(revision). Option("missingkey=error").Parse(source) if err != nil { return Artifact{}, err } var rendered bytes.Buffer if err := t.Execute(&rendered, p); err != nil { return Artifact{}, err } sum := sha256.Sum256(rendered.Bytes()) return Artifact{ EventID: p.EventID, OrderID: p.OrderID, TemplateRevision: revision, HTML: rendered.String(), SHA256: fmt.Sprintf("%x", sum), }, nil } func main() { payment := Payment{ EventID: "payment-settled-1042", OrderID: "order-1042", Status: "settled", AmountText: "79.00", Currency: "USD", } artifact, err := freeze(payment) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } encoder := json.NewEncoder(os.Stdout) encoder.SetIndent("", " ") if err := encoder.Encode(artifact); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } The judgment criterion is exact: the approved artifact is the input to delivery, including on retries. This example demonstrates the rendering boundary; it doesn't implement a production outbox, persistent deduplication, or a provider adapter. Those remain necessary integration work, and a digest doesn't establish approval or encrypt receipt contents.
In production, persist the artifact and delivery intent before dispatch, with an application-defined uniqueness constraint for the settled-payment receipt. Keep the recipient and channel selection in the controlled delivery record. A worker retry should reload that record instead of rebuilding the receipt from today's order state or template. Where the transport supports idempotency, use a stable identity for the same delivery intent; don't assume that local deduplication resolves an ambiguous network timeout.
That last distinction matters. If the provider accepted the request but the response was lost, retrying without an agreed deduplication contract can create another receipt. Marking the intent as complete before sending has the opposite failure: a crash can leave an unsent receipt looking finished. Evaluate that boundary explicitly during the provider trial.
Step 2: Inspect the sending-domain record before dispatch
The artifact settles content ownership. Domain authentication is a separate release check. For the unified API option above, this read-only Go example retrieves a domain record without inventing a send payload or treating an undocumented response field as a readiness flag. Save it separately as main.go and run it with go run main.go. Configure INFRAI_API_BASE with the documented HTTPS v1 base from your deployment configuration, INFRAI_API_KEY with your key, and SENDING_DOMAIN with the domain you manage.
package main import ( "context" "fmt" "io" "net/http" "net/url" "os" "strconv" "strings" "time" ) func inspect(ctx context.Context) error { base := strings.TrimRight(os.Getenv("INFRAI_API_BASE"), "/") key := os.Getenv("INFRAI_API_KEY") domain := os.Getenv("SENDING_DOMAIN") u, err := url.Parse(base) if err != nil || u.Scheme != "https" || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || u.Path != "/v1" || key == "" || domain == "" { return fmt.Errorf("configure the trusted HTTPS v1 base, key, and domain") } endpoint := base + "/email/domain/get/" + url.PathEscape(domain) client := &http.Client{ Timeout: 10 * time.Second, CheckRedirect: func(_ *http.Request, _ []*http.Request) error { return http.ErrUseLastResponse }, } for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) res, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(io.LimitReader(res.Body, 1<<20)) res.Body.Close() if readErr != nil { return readErr } if res.StatusCode == http.StatusTooManyRequests && attempt < 3 { delay := time.Second * time.Duration(1<<attempt) header := res.Header.Get("Retry-After") if seconds, err := strconv.Atoi(header); err == nil && seconds >= 0 { requested := time.Duration(seconds) * time.Second if requested > delay { delay = requested } } else if date, err := http.ParseTime(header); err == nil { if requested := time.Until(date); requested > delay { delay = requested } } timer := time.NewTimer(delay) select { case <-ctx.Done(): timer.Stop() return ctx.Err() case <-timer.C: } continue } if res.StatusCode < 200 || res.StatusCode >= 300 { return fmt.Errorf("domain lookup HTTP %d: %s", res.StatusCode, body) } fmt.Println(string(body)) return nil } return fmt.Errorf("domain lookup retry budget exhausted") } func main() { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() if err := inspect(ctx); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } Inspect the returned record against the documented domain-verification requirements; HTTP success alone isn't a readiness decision. The example bounds its retry budget, respects Retry-After on rate limits, and surfaces error bodies. It performs no write, so it needs no create-operation idempotency key. A production dispatch adapter still needs its own documented write contract and deduplication policy.
Step 3: Budget the receipt backlog and the observation lag
A template decision is also a capacity decision. Rendering during every retry consumes worker capacity, and a notification system can appear healthy while its receipt backlog grows because the throughput budget counted orders but forgot repeated attempts.
For a planning exercise, assume 600 settled orders per minute, a retry allowance equal to 10% of initial attempts, and a tested worker capacity of 900 attempts per minute. These are hypothetical inputs. The following independent Go program calculates the remaining drain capacity and the idealized time to clear a backlog of 1,800 attempts. Save it separately as main.go and run it with go run main.go.
package main import "fmt" func main() { ordersPerMinute := 600.0 retryFraction := 0.10 capacityPerMinute := 900.0 backlogAttempts := 1800.0 incomingAttempts := ordersPerMinute * (1 + retryFraction) drainPerMinute := capacityPerMinute - incomingAttempts if drainPerMinute <= 0 { panic("no spare capacity to drain the backlog") } fmt.Printf("Incoming attempts/min: %.0f\n", incomingAttempts) fmt.Printf("Spare attempts/min: %.0f\n", drainPerMinute) fmt.Printf("Ideal backlog drain minutes: %.1f\n", backlogAttempts/drainPerMinute) } The result is 660 incoming attempts per minute, 240 spare attempts per minute, and 7.5 minutes to drain that backlog under constant load. This is arithmetic, not a provider throughput claim. Throttling, worker downtime, and recipient-specific suppression can change the operational outcome.
Define an SLO for settlement-to-provider-acceptance separately from whatever recipient delivery evidence the provider supplies. Acceptance is observable at a different boundary from inbox placement. Put the oldest pending receipt age next to the queue depth; a low queue count can still hide one receipt that has been stuck for hours.
Observation has a budget too. For a pull-based event path, include the polling interval and processing delay in the alerting design, and provision polling capacity independently of send capacity. Suppression handling belongs in that design because repeated sends to a suppressed recipient should not be treated as a backlog the worker can drain through persistence alone.
An SMS escalation needs its own policy. Don't turn missing email evidence into an automatic text message without a recipient policy, suppression checks, and a clear rule for which order event deserves another channel. Keep country restrictions and abuse controls in the application's SMS policy, and retain scheduled receipts under application control until their dispatch decision is final.
When should the platform team choose another boundary?
Application-owned artifacts make the most sense when the merchant needs to reproduce a settled order's exact receipt and can maintain a release and retention process. A provider-managed editing workflow may fit better when frequent editorial changes dominate, provided the revision and replay exercise passes. If an application requires drop-in SMTP, treat API-only delivery as an integration change in the selection decision.
DKIM is still required work for a branded sending domain, but RFC 6376 describes a signing mechanism, not an inbox-placement guarantee. Verify the domain and rehearse key rotation alongside the receipt trial. Then make the provider choice from evidence about template ownership, delivery observation, and the on-call work your team can actually absorb.
The useful outcome is an accountable boundary: the merchant owns the approved receipt, the transport owns its documented delivery contract, and the platform team can explain which stage missed its SLO.
Sources
References for the provider evaluation and domain-signing checks:

