
Mailer Component
Email service, transports, Twig email templates, attachments, inline images, Mailer events
1Which interface should be used to inject the email sending service in Symfony?
Which interface should be used to inject the email sending service in Symfony?
Jawaban
MailerInterface is the main interface for sending emails in Symfony. It exposes a send() method that accepts a RawMessage or Email object. Injecting this interface enables autowiring and facilitates mocking in unit tests.
2How to configure the mailer DSN in Symfony?
How to configure the mailer DSN in Symfony?
Jawaban
The mailer DSN is configured via the MAILER_DSN environment variable. This approach follows Symfony best practices by separating sensitive configuration from code. The DSN format varies depending on the transport used (smtp, sendmail, or third-party services like mailgun, postmark, sendgrid).
3Which class should be used to create an email with a Twig template?
Which class should be used to create an email with a Twig template?
Jawaban
TemplatedEmail is the dedicated class for creating emails using Twig templates. It extends the Email class and adds the htmlTemplate() and textTemplate() methods to specify templates. The context() method allows passing variables to the Twig template.
How to add an attachment to a Symfony email?
Which method allows embedding an image directly in the HTML body of an email?
+13 pertanyaan wawancara
Topik wawancara Symfony lainnya
Modern PHP (8.1+)
Symfony Basics
Routing & Controllers
Twig & Templates
Doctrine ORM Basics
Symfony Forms
Data Validation
Dependency Injection & Services
Security & Authentication
Doctrine Advanced
API Platform
Serializer Component
Events & Event Subscribers
Console & Commands
Messenger Component
HTTP Client
Cache & Performance
Workflow Component
Testing Symfony
Translations & i18n
EasyAdmin Bundle
Symfony Architecture
Performance & Optimization
Security Advanced
Custom Bundles
Microservices with Symfony
Real-time & WebSockets
Deployment & DevOps
Kuasai Symfony untuk wawancara berikutnya
Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.
Mulai gratis