async-aws/ses
AsyncAws SES is a lightweight PHP client for Amazon Simple Email Service. Install via Composer and send emails or manage SES resources with a modern, typed API and async-friendly design. Full docs available at async-aws.com/clients/ses.html.
Pros:
Mail facade and queue workers (e.g., database, redis, beanstalkd).async-aws ecosystem, which follows a micro-package approach. Only pulls in SES-specific dependencies, reducing bloat compared to the full AWS SDK (~10x smaller).FromEmailAddress).async-aws/core, which supports non-blocking HTTP requests, critical for Laravel apps with high concurrency (e.g., SaaS platforms with 10K+ concurrent users).Cons:
async-aws/ses version (pre-1.14.0) or upgrade PHP.max_attempts). Custom retry policies (e.g., exponential backoff) must be implemented manually.Mail facade. Example:
use AsyncAws\Ses\SesClient;
use AsyncAws\Ses\Input\SendEmailRequest;
$ses = new SesClient();
$request = new SendEmailRequest([
'FromEmailAddress' => 'noreply@example.com',
'Destination' => ['ToAddresses' => ['user@example.com']],
'Content' => ['Simple' => ['Subject' => ['Data' => 'Hello'], 'Body' => ['Text' => ['Data' => 'World']]]],
]);
$ses->sendEmail($request);
Mail::to('user@example.com')->queue(new OrderConfirmation($order));
Mailable classes with SES-specific extensions (e.g., custom headers, attachments).ses:SendEmail, ses:SendRawEmail) and DKIM/SPF configuration. Can be automated via Terraform/CDK or documented as a one-time setup.async-aws/ses has no hard dependencies beyond PHP 8.2+ and async-aws/core. Conflicts with other AWS SDKs are unlikely due to namespace isolation.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| AWS SES Quotas | High | Monitor SES quotas (e.g., 14 emails/sec for production). Implement rate limiting in Laravel. |
| PHP 8.2+ Requirement | Medium | Upgrade PHP or use a legacy async-aws/ses version (e.g., 1.13.0 for PHP 8.1). |
| Async Latency | Low | Benchmark queue processing time. For critical emails, use SES sync API or a dedicated service. |
| SES Sandbox Limits | Medium | Plan for AWS approval delay (~2 days) during testing. Use a staging SES account. |
| Error Handling | Medium | Implement custom exception handlers for SES-specific errors (e.g., MessageRejected). |
| Cost Overruns | Low | Set AWS SES budget alerts and use the SES pricing calculator. |
eu-west-1, ap-southeast-1) and configure DNS accordingly.Laravel Compatibility:
async-aws/ses release (e.g., 1.13.0 for PHP 8.1).database, redis, beanstalkd, sqs). For high throughput, prioritize redis or sqs.log/array mail drivers with ses. Configure in .env:
MAIL_MAILER=ses
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_DEFAULT_REGION=us-east-1
MailFake for unit tests or mock AsyncAws\Ses\SesClient with PHPUnit.AWS Integration:
aws config (via config/aws.php) or environment variables.us-east-1, eu-west-1, fips-us-gov-east-1). Configure via SesClient constructor or Laravel’s AWS_DEFAULT_REGION.Phase 1: Setup (1–2 days)
composer require async-aws/ses
php artisan vendor:publish --provider="AsyncAws\Ses\SesServiceProvider"
.env with AWS credentials and region.Phase 2: Pilot (3–5 days)
async-aws/ses.php artisan queue:work --queue=ses
Phase 3: Rollout (1–2 weeks)
Phase 4: Optimization (Ongoing)
max_jobs for high-volume periods).| Component | Compatibility Notes |
|---|---|
| Laravel | 9.x+ (PHP 8. |
How can I help you explore Laravel packages today?