Skip to content

Releases

v0.1.1

Choose a tag to compare

@DanielDarrenJones DanielDarrenJones released this 22 Oct 21:23

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

Choose a tag to compare

@DanielDarrenJones DanielDarrenJones released this 18 Oct 16:01

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 the MailBatch facade send mailables, or capture the mail sent inside a callback, in as few requests as possible. They return a BatchResult with 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() and Notification::batchNow() send a notification to many notifiables with its mail batched. NotificationSent and NotificationFailed fire 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() and assertBatchCount().
    • Notification::fake() records batched notifications as sent.

Requirements

PHP 8.3+, Laravel 13.30+.

See the README for the behaviour that differs from sending mail one at a time.