brevo-php
Official PHP SDK for the Brevo API - transactional email, SMS, contacts, and CRM.
Repository Health
Technical Analysis
brevo-php is the official PHP client for the Brevo (formerly Sendinblue) marketing and transactional platform. It exposes every Brevo REST endpoint through namespaced, strongly-typed resource clients so you can send transactional email, SMS, and WhatsApp messages, manage contacts and lists, and drive campaigns, deals, and CRM data without hand-writing HTTP requests.
Built on PSR-18 and PSR-7 interfaces, the SDK works with any compliant HTTP client, ships automatic retries with exponential backoff, and models request and response payloads as typed classes for editor autocompletion and safer integrations.
What You Get
- A unified
Brevoclient with namespaced resource accessors for every API area - Typed request and response models for transactional email, SMS, WhatsApp, contacts, and CRM
- PSR-18 HTTP client support with pluggable custom clients (Guzzle, Symfony HttpClient)
- Automatic retries with exponential backoff for transient failures
- Structured exception handling via BrevoApiException with status code and response body access
Common Use Cases
- Sending transactional emails such as receipts, password resets, and notifications
- Managing contacts, lists, and segments programmatically
- Creating and tracking email and SMS marketing campaigns
- Syncing CRM deals, companies, and tasks from a PHP backend
Under The Hood
Architecture - A single Brevo client (src/Brevo.php) composes dozens of resource sub-clients grouped by domain (TransactionalEmails, Contacts, EmailCampaigns, Deals, Companies, and more), each wrapping the shared Core request pipeline that serializes typed request objects, dispatches over a PSR-18 client, and deserializes typed responses. Tech Stack - PHP 8.1+ built on PSR-7/PSR-17/PSR-18 HTTP abstractions, with php-http/discovery for client auto-detection and multipart-stream-builder for file uploads; dev tooling uses PHPUnit 12, PHPStan, and php-cs-fixer, with WireMock for HTTP contract tests. Code Quality - The codebase is programmatically generated from Brevo’s API spec, giving highly consistent naming and structure across hundreds of model classes; a tests/ suite plus WireMock stubs and PHPStan static analysis back the generated code. API Design - The namespaced $client->transactionalEmails->sendTransacEmail(...) shape reads intuitively, request objects are self-descriptive, and advanced concerns (custom clients, retries, timeouts, logging) are handled through a consistent options array.