Transactional Email Envelope Builder
Builds a normalized transactional email envelope with recipient validation, subject trimming, and headers.
Open SnippetPractical pure PHP patterns that are easy to study, adapt and use.
Builds a normalized transactional email envelope with recipient validation, subject trimming, and headers.
Open SnippetParses mail delivery provider responses into accepted, deferred, bounced, or failed status records.
Open SnippetCreates a double opt-in request plan with token expiry, recipient hash, and replay protection metadata.
Open SnippetBuilds unsubscribe token metadata with route, expiry, scope, and one-click email compliance fields.
Open SnippetChecks a generated order number against known identifiers and prepares retry guidance when collisions exist.
Open SnippetReviews cart lines and merges compatible SKU, option, and price records without losing quantity detail.
Open SnippetReconciles cart subtotal, discounts, tax, shipping, and grand total using integer cents.
Open SnippetTraces discount-rule eligibility decisions so an admin can see why each rule passed or failed.
Open SnippetResolves a tax region from shipping country, state, postal prefix, and fallback rules.
Open SnippetAudits shipping-rate candidates and selects the lowest eligible service while recording rejection reasons.
Open SnippetPlans inventory reservation expiry windows from cart age, stock pressure, and payment state.
Open SnippetChecks invoice lines for negative values, quantity errors, subtotal drift, and duplicate SKU rows.
Open Snippet