Technical Mid Level

How do you handle email sending in Symfony? Discuss the Mailer component, async delivery, and the Notifier component for multi-channel messaging.

Quick Tip

Show the async pattern: "I configure Mailer to use Messenger. When the controller sends an email, it is dispatched to the queue and a worker sends it. The user gets an instant response. Failed emails land in the failure transport for retry."

What good answers include

Symfony Mailer: create Email or TemplatedEmail objects, send via MailerInterface. For async delivery: configure Messenger transport and Mailer routes messages through it automatically — emails are queued and sent by workers, keeping HTTP responses fast. The Notifier component extends this to SMS, Slack, Telegram, and other channels via a unified interface. Strong candidates discuss: Mailer DSN configuration for providers (SendGrid, Mailgun, SES), email testing with the profiler and Mailtrap, Twig-based email templates with inlined CSS, and using Notifier channels to avoid scattering notification logic across the codebase.

What interviewers are looking for

Tests understanding of async processing in web applications. Candidates who send emails synchronously in controllers will create slow endpoints. Those who understand Mailer + Messenger integration build responsive applications.

← All Symfony questions