Symfony
Learn how to send your first email using the Symfony Resend Mailer Bridge.
Prerequisites
To get the most out of this guide, you will need to:
1. Install
Get the Resend Mailer Bridge package.
If your application relies on Resend webhook events, you should also install the Symfony Webhook Component.
2. Configuring Mailer
In your .env.local
file, which you can create if needed, add the following:
Replace API_KEY
with your Resend API key, and SIGNING_SECRET
with your webhook secret, which can be retrieved from the Resend dashboard after creating a new webhook endpoint (see below).
3. Send your first email
In a controller, inject the Mailer
:
In a controller action, use the $this->mailer
to send your email:
Learn more about sending emails with Mailer Component in Symfony’s documentation.
4. Receive and handle webhooks
Thanks to the Webhook Component, you can create a webhook listener.
Bind your listener to the Webhook routing config:
Next, register your application’s webhook endpoint URL (example: https://{app_domain}/webhook/mailer_resend
) in the Resend Dashboard:
5. Try it yourself
Symfony Example
See the full source code.
Was this page helpful?