jeffersongoncalves/laravel-postmark
Laravel Postmark integration that connects Postmark's transactional email API to your Laravel app. Provides a mail transport and simple configuration so you can swap your default mailer for Postmark and send reliable, deliverable email with minimal setup.
Assumption to validate: The feature set (sendEmail, sendBatch, bounces, message search, stats, suppressions, PostmarkException with ErrorCode) maps one-to-one onto Postmark's API surface. This assessment assumes it is a Laravel-oriented Postmark API client. If that assumption is wrong, the analysis below needs redoing.
Architecture fit
Mail/Notifiable. The important architectural point: the package exposes both the send path and the Postmark control plane (templates, bounces, stats, suppressions). Adopting it therefore tends to become a decision to standardize on Postmark as the ESP, not just to swap a mail transport.Integration feasibility
composer require, publish config, set server token (sends) and account token (server/account-level operations) via env, then call through the container. Low effort for the happy path.Technical risk
Http client, or whether it integrates with Mail/Notification channels. All three materially affect fit.list, dump), but production bounce/inbound handling is webhook-driven. If the package does not offer webhook routes or payload verification, you will build and own that layer — a meaningful scope correction to "just install it."Key questions for the maintainer
Http::fake compatibility, or an assertion API?Mail transport / notification channel, or is it API-calls-only?PostmarkException design: does ErrorCode map to a stable enum or constants, and does the exception preserve the response body and HTTP status for logging?Stack fit
Mail facade plus a first-party transport covers that with less surface area and no extra dependency. The package earns its place when you consume the templates/bounces/stats/suppressions APIs.ShouldQueue mailables or explicit jobs) with the package called from the job, not the request cycle.Migration path
Compatibility
config:cache safety (no closures or env() calls at runtime), and confirm exception types are distinguishable from your existing mail exceptions so error handling and alerting do not silently merge the two providers.Sequencing
Maintenance
Support
PostmarkException carrying ErrorCode plus the error body is genuinely good for triage; make sure both are logged verbatim. Postmark's error codes distinguish invalid token, inactive recipient, and malformed payload, which turns most pages into self-service diagnoses.Scaling
sendBatch/sendBatchWithTemplates are the correct scaling lever — batch where the use case allows, but design for partial batch failure rather than assuming all-or-nothing.dump and filtered list calls on a schedule can consume significant rate budget; prefer webhooks where available and back off aggressively on polling.Failure modes
| Failure | Impact | Detection | Mitigation |
|---|---|---|---|
| API token misconfigured / wrong scope | All sends fail, 401/403 | Exception with ErrorCode |
Startup config validation; distinct alert per error class |
| Rate limit exceeded | Throttled sends, queue backlog | 429s, latency spike | Queue + backoff + token bucket; avoid synchronous sends |
| Vendor outage | Transactional mail stops | Send error rate | Queue-based retry with jitter; documented fallback provider |
| Duplicate sends on retry | User-visible duplicates | Duplicate complaint reports | No idempotency in Postmark — dedupe keyed on business event before enqueue |
| Template drift (edited in Postmark UI) | Broken rendering, missing variables | Render errors, QA | Template definitions in version control; treat UI edits as break-glass |
| Suppression desync | Mail to unsubscribed/bounced addresses | Compliance review | Sync suppressions to your own preference store as source of interest |
| No webhook layer (if confirmed) | Slow bounce handling, list degradation | Rising bounce rate | Build and own webhook receiver; do not rely on polling alone |
| Silent dependency break on upgrade | Fatal on deploy | CI | Lockfile pinning, contract tests against a fake |
Ramp-up
sendEmail, sendEmailWithTemplate): roughly half a day for an engineer familiar with Laravel mail; the surrounding queue, logging, and error-handling work is the bulk.How can I help you explore Laravel packages today?