This example shows how to use Resend with Symfony.
Note
This application uses Symfony 7.1 RC1. It will be updated to the stable version once it's released.
To get the most out of this guide, you’ll need to:
-
Go to
./application
directory -
Create a
.env.local
file and pasteMAILER_DSN=resend+api://API_KEY@default
then replaceAPI_KEY
with your API key. -
Install dependencies:
composer install
- Start the server:
symfony serve -d
-
Open your browser and go to
https://127.0.0.1:8000/
-
Click on the button to send an email.
-
Expose your local server to the internet using expose.dev.
-
Register your webhook URL (
{EXPOSE_URL}/webhook/mailer_resend
) in Resend settings. Check the wanted events. -
Paste
MAILER_RESEND_SECRET=SECRET_KEY
on.env.local
and replaceSECRET_KEY
with your webhook signing secret you get after registering the webhook in Resend. -
Click on the button to send an email.
-
Go to
https://127.0.0.1:8000/email-statuses
to see received events (stored invar/emails.json
)
MIT License