waaseyaa / mail
Transport-agnostic mail API for Waaseyaa
Requires
- php: >=8.5
- waaseyaa/foundation: ^0.1.0-alpha.256
Requires (Dev)
- phpunit/phpunit: ^10.5
- twig/twig: ^3.0
Suggests
- sendgrid/sendgrid: Required for SendGrid API transport when using mail.sendgrid_api_key (^8.1)
- twig/twig: Required for TwigMailRenderer template support
This package is auto-updated.
Last update: 2026-07-06 21:32:25 UTC
README
Layer 0 — Foundation
Email delivery abstraction for Waaseyaa applications.
Provides a MailerInterface and Twig-powered TwigMailRenderer for template-based emails.
Key classes: MailerInterface, Envelope, TwigMailRenderer, TransportInterface (local, array, SendGrid).
Error handling
Non-critical mail (e.g. notification side effects, activity digests): wrap the MailerInterface::send() call in a try-catch and log the failure via LoggerInterface to avoid crashing the primary request. These are best-effort deliveries where a failure is recoverable.
Auth-critical mail (password resets, email-address verification, security alerts): let the exception propagate. Swallowing a send failure here would silently leave the user unable to regain access or verify their account. Catch only to add context or translate the exception, then re-throw.