- How do I send emails using Resend with Laravel’s Mail facade?
- Configure your `MAIL_MAILER=resend` in `.env` and set `RESEND_API_KEY`. Then use Laravel’s built-in Mail facade or Mailable classes—no additional code changes are needed. The package automatically routes emails through Resend’s API.
- Does this package support Laravel’s queue system for delayed emails?
- Yes, the package integrates with Laravel’s queue system out of the box. Simply dispatch your Mailable with `Mail::to()->queue()` or use `Mail::later()`, and Resend will handle the delayed delivery via its API.
- How do I handle suppressed emails in Laravel applications?
- Suppressed emails are now visible via `Resend::emails()->list()` and trigger `email.suppressed` webhooks. Use the `EmailSuppressed` event to dispatch custom logic, such as updating user profiles or analytics, by listening to the event in your service providers.
- What Laravel versions are supported by resend/resend-laravel?
- The package supports Laravel 10.x and 11.x. Ensure your project’s `composer.json` specifies a compatible Laravel version, as the package follows Laravel’s semantic versioning. PHP 8.1+ is required.
- Can I use Resend’s React email templates with Laravel?
- Yes, the package supports Resend’s React-based email templates. Pass the template HTML directly in your Mailable’s `build()` method or use the `Resend` facade’s `send()` method with a `html` key. No additional setup is required beyond your existing Laravel mail configuration.
- How do I test suppressed email status in Laravel tests?
- Use the `Resend::fake()` helper to simulate suppressed emails. Assert suppressed status with `Resend::fake()->assertSuppressed()` in your test cases. This works alongside Laravel’s existing `assertSent` and `assertQueued` methods for comprehensive email testing.
- What happens if Resend’s API fails to report suppressed status?
- The package does not modify existing behavior for suppressed emails if Resend’s API fails to report it. However, you can extend the package by implementing a fallback mechanism, such as logging suppressed emails locally or using Laravel’s event system to track them manually.
- Are there alternatives to this package for Laravel email delivery?
- Yes, alternatives include Laravel’s built-in SMTP driver, Postmark’s Laravel package (`laravel-postmark`), or SendGrid’s Laravel integration (`laravel-sendgrid`). However, `resend/resend-laravel` is optimized for Resend’s API, including features like suppressed status and React templates.
- How do I process Resend webhooks for suppressed emails in Laravel?
- Update your webhook route or job handler to check for `email.suppressed` events. Use Laravel’s `HandleIncomingWebhook` middleware or a custom job to process the payload. Example: `if ($payload['event'] === 'email.suppressed') { event(new EmailSuppressed($payload['data'])); }`
- Does this package work with Laravel’s notifications system?
- Yes, the package integrates seamlessly with Laravel’s notifications. Configure `MAIL_MAILER=resend` and use `Notification::send()` as usual. The package automatically routes notifications through Resend’s API, including email templates and suppressed status tracking.