Repository navigation
Releases
Releases · 1994limited/laravel-mail-batch
v0.1.1
Documentation only: no code changes since v0.1.0.
Changed
- The README now covers installing from Packagist: requirements (PHP 8.3+, Laravel 13.30+), auto-discovery with nothing to publish, what to configure for each mailer, and how 0.x versions are numbered.
- Added Packagist badges.
Full changelog: v0.1.0...v0.1.1
v0.1.0
First release of Laravel Mail Batch. It sends Laravel mail and notifications in batches, paced to your provider's rate limits, without replacing any of Laravel's services.
Features
Mail::batch()and theMailBatchfacade send mailables, or capture the mail sent inside a callback, in as few requests as possible. They return aBatchResultwith the result of each message.- Size, interval or requests per second, and retries can be set fluently or per mailer in
config/mail.php. Notification::batch()andNotification::batchNow()send a notification to many notifiables with its mail batched.NotificationSentandNotificationFailedfire for each notifiable with the provider's response.- Queued notifications are grouped into one job per batch. Each notifiable keeps its notification ID, and the jobs are spaced out to stay close to the rate limit.
#[BatchMail(size:, interval:, perSecond:, mailer:)]configures a notification's batch.- Batch transports:
resend-batch: up to 100 emails per request, with idempotency keys that are kept when a request or job is retried.postmark-batch: up to 500 emails per request.
- Every other mailer still works. It sends one message per request, paced.
- Testing helpers:
- With
Mail::fake(), nothing reaches a transport. MailBatch::assertBatched(),assertNotBatched()andassertBatchCount().Notification::fake()records batched notifications as sent.
- With
Requirements
PHP 8.3+, Laravel 13.30+.
See the README for the behaviour that differs from sending mail one at a time.