diff --git a/components/http_kernel.rst b/components/http_kernel.rst index 3fd76780295..ac2733058e0 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -498,12 +498,6 @@ as possible to the client (e.g. sending emails). Using the ``kernel.terminate`` event is optional, and should only be called if your kernel implements :class:`Symfony\\Component\\HttpKernel\\TerminableInterface`. -.. sidebar:: ``kernel.terminate`` in the Symfony Framework - - If you use the :ref:`memory spooling ` option of the - default Symfony mailer, then the `EmailSenderListener`_ is activated, which - actually delivers any emails that you scheduled to send during the request. - .. _component-http-kernel-kernel-exception: Handling Exceptions: the ``kernel.exception`` Event @@ -783,5 +777,4 @@ Learn more .. _`SensioFrameworkExtraBundle`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html .. _`@ParamConverter`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html .. _`@Template`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/view.html -.. _`EmailSenderListener`: https://github.com/symfony/swiftmailer-bundle/blob/master/EventListener/EmailSenderListener.php .. _variadic: https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list diff --git a/console/command_in_controller.rst b/console/command_in_controller.rst index 74cd6b09cbe..91ead2a7801 100644 --- a/console/command_in_controller.rst +++ b/console/command_in_controller.rst @@ -20,11 +20,9 @@ Instead, you can run the command directly from the controller. a controller has a slight performance impact because of the request stack overhead. -Imagine you want to send spooled Swift Mailer messages by -:doc:`using the swiftmailer:spool:send command `. -Run this command from inside your controller via:: +Imagine you want to run the ``debug:twig`` from inside your controller:: - // src/Controller/SpoolController.php + // src/Controller/DebugTwigController.php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Console\Application; @@ -34,19 +32,19 @@ Run this command from inside your controller via:: use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; - class SpoolController extends AbstractController + class DebugTwigController extends AbstractController { - public function sendSpool(int $messages = 10, KernelInterface $kernel): Response + public function debugTwig(KernelInterface $kernel): Response { $application = new Application($kernel); $application->setAutoExit(false); $input = new ArrayInput([ - 'command' => 'swiftmailer:spool:send', + 'command' => 'debug:twig', // (optional) define the value of command arguments 'fooArgument' => 'barValue', // (optional) pass options to the command - '--message-limit' => $messages, + '--bar' => 'fooValue', ]); // You can use NullOutput() if you don't need the output @@ -76,7 +74,7 @@ First, require the package: Now, use it in your controller:: - // src/Controller/SpoolController.php + // src/Controller/DebugTwigController.php namespace App\Controller; use SensioLabs\AnsiConverter\AnsiToHtmlConverter; @@ -85,7 +83,7 @@ Now, use it in your controller:: use Symfony\Component\HttpFoundation\Response; // ... - class SpoolController extends AbstractController + class DebugTwigController extends AbstractController { public function sendSpool(int $messages = 10): Response { diff --git a/email.rst b/email.rst index 60e630abc38..c5517bef991 100644 --- a/email.rst +++ b/email.rst @@ -4,10 +4,11 @@ Swift Mailer ============ -.. note:: +.. caution:: - In Symfony 4.3, the :doc:`Mailer ` component was introduced and can - be used instead of Swift Mailer. + In Symfony 4.3, the :doc:`Mailer ` component was introduced and should + be used instead of Swift Mailer as it won't be maintained anymore as of November + 2021. Symfony provides a mailer feature based on the popular `Swift Mailer`_ library via the `SwiftMailerBundle`_. This mailer supports sending messages with your diff --git a/mailer.rst b/mailer.rst index e8191db3461..eddc04e8ef7 100644 --- a/mailer.rst +++ b/mailer.rst @@ -3,8 +3,8 @@ Sending Emails with Mailer .. versionadded:: 4.3 - The Mailer component was introduced in Symfony 4.3. The previous solution, - called Swift Mailer, is still valid: :doc:`Swift Mailer `. + The Mailer component was introduced in Symfony 4.3 and replaces Swift + Mailer. Installation ------------ diff --git a/migration.rst b/migration.rst index ce5bbbcd209..6b0807588aa 100644 --- a/migration.rst +++ b/migration.rst @@ -82,7 +82,7 @@ Setting up Composer Another point you will have to look out for is conflicts between dependencies in both applications. This is especially important if your existing application already uses Symfony components or libraries commonly -used in Symfony applications such as Doctrine ORM, Swiftmailer or Twig. +used in Symfony applications such as Doctrine ORM or Twig. A good way for ensuring compatibility is to use the same ``composer.json`` for both project's dependencies.