This course is still being released! Check back later for more chapters.

Get Notified About this Course!

We will send you messages regarding this course only
and nothing else, we promise.
You can unsubscribe anytime by emailing us at:
privacy@symfonycasts.com
> Symfony 7 >

Course Overview

Login to bookmark this course

Mailer y Webhook con Mailtrap

Master sending and tracking stylish emails in Symfony & Mailtrap.

  • intermediate
  • 252 students
  • EN/ES Captions
  • EN/ES Script
  • Certificate of Completion

Your Guides

About this course

What PHP libraries does this tutorial use?

// composer.json
{
    "require": {
        "php": ">=8.2",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/dbal": "^3", // 3.9.4
        "doctrine/doctrine-bundle": "^2.13", // 2.13.2
        "doctrine/doctrine-fixtures-bundle": "^3.6", // 3.7.1
        "doctrine/orm": "^3.3", // 3.3.1
        "league/html-to-markdown": "^5.1", // 5.1.1
        "symfony/asset": "7.2.*", // v7.2.0
        "symfony/asset-mapper": "7.2.*", // v7.2.0
        "symfony/console": "7.2.*", // v7.2.1
        "symfony/doctrine-messenger": "7.2.*", // v7.2.3
        "symfony/dotenv": "7.2.*", // v7.2.0
        "symfony/flex": "^2", // v2.4.7
        "symfony/form": "7.2.*", // v7.2.0
        "symfony/framework-bundle": "7.2.*", // v7.2.2
        "symfony/mailer": "7.2.*", // v7.2.0
        "symfony/mailtrap-mailer": "7.2.*", // v7.2.0
        "symfony/messenger": "7.2.*", // v7.2.3
        "symfony/monolog-bundle": "^3.10", // v3.10.0
        "symfony/runtime": "7.2.*", // v7.2.0
        "symfony/security-csrf": "7.2.*", // v7.2.2
        "symfony/stimulus-bundle": "^2.21", // v2.22.1
        "symfony/twig-bundle": "7.2.*", // v7.2.0
        "symfony/validator": "7.2.*", // v7.2.2
        "symfony/yaml": "7.2.*", // v7.2.0
        "symfonycasts/tailwind-bundle": "^0.7.1", // v0.7.1
        "twig/cssinliner-extra": "^3.18", // v3.18.0
        "twig/extra-bundle": "^3.0", // v3.18.0
        "twig/inky-extra": "^3.19", // v3.19.0
        "twig/twig": "^3.0" // v3.18.0
    },
    "require-dev": {
        "phpunit/phpunit": "^9.5", // 9.6.22
        "symfony/browser-kit": "7.2.*", // v7.2.0
        "symfony/css-selector": "7.2.*", // v7.2.0
        "symfony/debug-bundle": "7.2.*", // v7.2.0
        "symfony/maker-bundle": "^1.61", // v1.62.1
        "symfony/phpunit-bridge": "^7.1", // v7.2.0
        "symfony/stopwatch": "7.2.*", // v7.2.2
        "symfony/web-profiler-bundle": "7.2.*", // v7.2.2
        "zenstruck/browser": "^1.9", // v1.9.1
        "zenstruck/foundry": "^2.2" // v2.3.0
    }
}

Sí, tarde o temprano tendrás que enviar correos electrónicos desde tu aplicación! Puede que sea un ¡Gracias por registrarte!, ¡Tu pedido está listo!, o incluso un ¡Creemos que eres fabuloso, aquí tienes un descuento! correo electrónico. Sea como sea, con el componente Mailer de Symfony y Mailtrap, enviar correos electrónicos puede ser divertido en desarrollo y sencillo y fiable en producción. En este tutorial, potenciaremos tus correos electrónicos dominando Mailer de Symfony + probando y pasando a producción con Mailtrap:

  • Instalación y configuración del Mailer de Symfony.
  • Previsualizar fácilmente los correos enviados con el perfilador de Symfony y la herramienta de pruebas de Mailtrap.
  • Uso de Twig para añadir HTML a tus correos electrónicos.
  • Incluir y alinear estilos CSS en tus correos electrónicos.
  • Integrar el framework Foundation CSS con Inky.
  • Añadir archivos adjuntos, imágenes incrustadas y establecer una dirección global "de".
  • Etiquetas y metadatos para rastrear y organizar tus correos electrónicos.
  • Añadir aserciones de correo electrónico a tus pruebas funcionales.
  • Envío asíncrono de correos para agilizar las respuestas.
  • Configurar la entrega en producción con el puente de Mailtrap.
  • Enviar correos desde la línea de comandos.

Y luego... ¡nos sumergiremos en el seguimiento de correos electrónicos y webhooks!

  • Configuración de Symfony Webhook para capturar cada apertura, clic y rebote.
  • Configurar el enrutamiento, el análisis y el consumidor de eventos de Mailtrap.
  • Prueba tu configuración de webhook localmente con Mailtrap y ngrok.

Así que vamos a conseguir que esos correos vuelen, tengan un aspecto estupendo y hagan un seguimiento perfecto.

Next courses in the Symfony 7: Learn More Tricks section of the Symfony 7 Track!

10 Comments

Sort By
Login or Register to join the conversation
Ruslan avatar Ruslan 3 months ago

Thank you.
I waiting for something like this course.

2 | Reply |

Hey @Ruslan, I'm happy to hear this!

2 | Reply |
Ruslan avatar Ruslan 27 days ago

Hi,
Probably you will add some examples : How to write IMAP client? :)

| Reply |

Hey @Ruslan

Nice try =) You know writing some clients is a pretty complex task, and it will not fit in any course. I bet there are libraries and that is not required to do by yourself. However, we register your idea in the backlog =)

Cheers!

| Reply |

I mean not "full" client, may be console command for some tasks like:

  1. Connect by IMAP
  2. Check IMAP folder
  3. Find email by part of header , get sender, connect to specific folder (spam, inbox, ..)
  4. Delete email or something else.

It's helpful task for mailing - FBL (Feed Back Loops) control email.
BR.

| Reply |

Yep, thanks for clarification.

Cheers!

| Reply |
David-B avatar David-B 2 months ago

Can you please include an 'unsubscribe' feature?

| Reply |

Hey @David-B,

I don't think it will include this. symfony/mailer is for transactional emails only which don't require an unsubscribe link.

1 | Reply |
Kibelisa-K avatar Kibelisa-K 2 months ago

hey coach can you make a follower system in symfony ?

| Reply |

It would be great if you could include how to create dynamic transports aside from the one configured in the configuration. I think this helps with developers who are creating SaaS applications that need to set the transports for the mail service dynamically.

| Reply |

Delete comment?

Share this comment

astronaut with balloons in space

"Houston: no signs of life"
Start the conversation!