Код: Выделить всё
$mailer->send(
$user->email,
$this->translator->trans('mails.recover.subject'),
'email/client/password-recovery.html.twig',
compact('user', 'hash', 'target')
);
< /code>
шаблон: < /p>
{% extends 'email/base.html.twig' %}
{% block content %}
{{ 'mails.recover.header' | trans({'%name%': user.name}) }}
{{ 'mails.recover.text1' | trans({'%url%': url('default')}) | raw }}
// More code
< /code>
Messenger Config: < /p>
framework:
messenger:
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
# failure_transport: failed
transports:
# https://symfony.com/doc/current/messenger.html#transport-configuration
async: '%env(MESSENGER_TRANSPORT_DSN)%'
# failed: 'doctrine://default?queue_name=failed'
# sync: 'sync://'
routing:
# Route your messages to the transports
# 'App\Message\YourMessage': async
'Symfony\Component\Mailer\Messenger\SendEmailMessage': async
Если я удалю строку
Код: Выделить всё
'Symfony\Component\Mailer\Messenger\SendEmailMessage': async
Подробнее здесь: https://stackoverflow.com/questions/625 ... -messenger