Symfony Brevo Mailer

Symfony Mailer bridge for sending transactional email through Brevo over SMTP or API.

SDK
Composer
vv8.1.0
25stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
57/100Fair
Development Activity64
Maintenance76
Community24
Maturity52
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture82
Code Quality88
Innovation72
Learning Curve90

Symfony Brevo Mailer is the official Symfony Mailer bridge for Brevo (formerly Sendinblue), the transactional email and marketing platform. It registers a brevo transport that plugs directly into Symfony’s Mailer component, letting you deliver mail through Brevo’s SMTP relay or its HTTP API by simply setting a MAILER_DSN.

Beyond basic delivery, the bridge maps Symfony email headers to Brevo-specific features such as template IDs, tags, metadata, and custom parameters, and it ships a webhook request parser that converts Brevo’s delivery, open, click, and bounce events into Symfony RemoteEvent objects for engagement tracking.

What You Get

  • A brevo mailer transport supporting both SMTP relay and HTTP API delivery
  • DSN-based configuration that drops into Symfony Mailer with no custom wiring
  • Header mapping for Brevo template IDs, tags, metadata, and custom parameters
  • A webhook request parser that turns Brevo events into Symfony RemoteEvent objects
  • PHPUnit-backed test coverage for the transport, factory, and webhook payloads

Common Use Cases

  • Sending transactional email (receipts, password resets, notifications) from a Symfony app via Brevo
  • Triggering Brevo-hosted email templates by ID with dynamic parameters
  • Tagging outbound mail for segmentation and reporting inside Brevo
  • Ingesting Brevo delivery, open, click, and bounce webhooks to track engagement

Under The Hood

Architecture - The bridge follows Symfony Mailer’s transport-factory pattern. BrevoTransportFactory extends AbstractTransportFactory and, based on the DSN scheme (brevo, brevo+smtp, or brevo+api), instantiates either BrevoSmtpTransport (a thin Esmtp transport) or BrevoApiTransport (extending AbstractApiTransport). The API transport builds a JSON payload, POSTs it to Brevo’s /v3/smtp/email endpoint with the api-key header, and translates Symfony’s TagHeader/MetadataHeader into Brevo fields. Inbound events flow through Webhook/BrevoRequestParser and RemoteEvent/BrevoPayloadConverter, which map raw callbacks to typed RemoteEvent objects.

Tech Stack - Pure PHP requiring PHP >= 8.4.1 and symfony/mailer ^7.4|^8.0, with symfony/http-client and symfony/webhook as dev/runtime peers. It relies on PSR event-dispatcher and logger interfaces and Symfony’s HttpClient contracts. No external SDK dependency beyond Symfony components; the HTTP calls are hand-rolled against Brevo’s REST API.

Code Quality - The code is small, strictly typed, and uses modern PHP 8.4 features including constructor property promotion and the #[\SensitiveParameter] attribute on the API key. Final classes and clear single-responsibility separation (transport vs. factory vs. webhook parser) keep it maintainable. A PHPUnit suite under Tests/ covers the factory, API transport, and webhook parsing with JSON/PHP fixtures for every event type.

API Design - Developer experience is excellent: integration is a single MAILER_DSN change with no service wiring, and advanced Brevo features are driven through standard Symfony email headers rather than a bespoke API. Naming mirrors the rest of Symfony Mailer’s bridge ecosystem, so anyone familiar with Symfony mailing will be productive immediately.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search