From 24e65fab43852636e9d8dbf7fe3e1546dbd1212b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 14 May 2018 21:53:20 +0200 Subject: [PATCH 01/26] some tweaks for the Messenger component docs --- messenger.rst | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/messenger.rst b/messenger.rst index c231877d34b..c5b1971630f 100644 --- a/messenger.rst +++ b/messenger.rst @@ -187,6 +187,36 @@ the messenger component, the following configuration should have been created: ], ]); + .. code-block:: xml + + + + + + + + + + + + + .. code-block:: php + + // config/packages/messenger.php + $container->loadFromExtension('framework', array( + 'messenger' => array( + 'transports' => array( + 'amqp' => '%env(MESSENGER_DSN)%', + ), + ), + )); + .. code-block:: bash # .env @@ -423,6 +453,23 @@ your ``transports`` configuration or it can be your own receiver. It also requires a ``--bus`` option in case you have multiple buses configured, which is the name of the bus to which received messages should be dispatched. + .. code-block:: xml + + + + + + + + + + + + + Middleware ---------- @@ -555,6 +602,37 @@ within the buses to add some extra capabilities like this: Note that if the service is abstract, a different instance of the service will be created per bus. + .. code-block:: xml + + + + + + + + + + + + .. code-block:: php + + // config/packages/messenger.php + $container->loadFromExtension('framework', array( + 'messenger' => array( + 'buses' => array( + 'messenger.bus.default' => array( + 'default_middleware' => false, + ), + ), + ), + )); + Using Middleware Factories ~~~~~~~~~~~~~~~~~~~~~~~~~~ From 489b745fd8e61ae5a51d909b329909757beb8d2e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 6 Jun 2018 12:41:15 +0200 Subject: [PATCH 02/26] Updated the embed controllers article --- quick_tour/the_view.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 quick_tour/the_view.rst diff --git a/quick_tour/the_view.rst b/quick_tour/the_view.rst new file mode 100644 index 00000000000..e69de29bb2d From dd5d8208f1a359174ba36926f0ced02791bbed74 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 25 Jun 2018 12:12:06 +0200 Subject: [PATCH 03/26] Removed the full config dumps from config reference articles --- reference/configuration/assetic.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 reference/configuration/assetic.rst diff --git a/reference/configuration/assetic.rst b/reference/configuration/assetic.rst new file mode 100644 index 00000000000..e69de29bb2d From 8f2b54129aa53fc8d836590981494bf5e7c5b01a Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 3 Jul 2018 10:21:31 +0200 Subject: [PATCH 04/26] More fixes about Twig classes namespaces --- components/form.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/components/form.rst b/components/form.rst index 2f71db1b32e..1e5c9753d93 100644 --- a/components/form.rst +++ b/components/form.rst @@ -189,7 +189,6 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension use Symfony\Bridge\Twig\Form\TwigRendererEngine; use Twig\Environment; use Twig\Loader\FilesystemLoader; - use Twig\RuntimeLoader\FactoryRuntimeLoader; // the Twig file that holds all the default markup for rendering forms // this file comes with TwigBridge From 825c8051fd132212ca31cf8fc80e69a2fc6b1136 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 5 Jul 2018 10:36:44 +0200 Subject: [PATCH 05/26] Removed more PHP template examples --- reference/forms/twig_reference.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 reference/forms/twig_reference.rst diff --git a/reference/forms/twig_reference.rst b/reference/forms/twig_reference.rst new file mode 100644 index 00000000000..e69de29bb2d From 58ed809f9123e55d5a3e9cd296d09d375211d8f8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 11 Jul 2018 15:39:40 +0200 Subject: [PATCH 06/26] Added the versionadded directive --- service_container/alias_private.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service_container/alias_private.rst b/service_container/alias_private.rst index 18d1d22464c..889a9f78d28 100644 --- a/service_container/alias_private.rst +++ b/service_container/alias_private.rst @@ -153,6 +153,9 @@ Anonymous Services Anonymous services are only supported by the XML and YAML configuration formats. +.. versionadded:: 3.3 + The feature to configure anonymous services in YAML was introduced in Symfony 3.3. + In some cases, you may want to prevent a service being used as a dependency of other services. This can be achieved by creating an anonymous service. These services are like regular services but they don't define an ID and they are From 0e5173036038212f23c0c440e123668410ea21d3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 11 Jul 2018 18:03:45 +0200 Subject: [PATCH 07/26] Moved PHP-related code from Forms to the PHP templating page --- templating/PHP.rst | 216 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) diff --git a/templating/PHP.rst b/templating/PHP.rst index 6051199c80a..d561f79488e 100644 --- a/templating/PHP.rst +++ b/templating/PHP.rst @@ -563,4 +563,220 @@ original template: escape($help) ?> +Form Theming in PHP +------------------- + +When using PHP as a templating engine, the only method to customize a fragment +is to create a new template file - this is similar to the second method used by +Twig. + +The template file must be named after the fragment. You must create a ``integer_widget.html.php`` +file in order to customize the ``integer_widget`` fragment. + +.. code-block:: html+php + + +
+ block( + $form, + 'form_widget_simple', + array('type' => isset($type) ? $type : "number") + ) ?> +
+ +Now that you've created the customized form template, you need to tell Symfony +to use it. Inside the template where you're actually rendering your form, +tell Symfony to use the theme via the ``setTheme()`` helper method:: + + setTheme($form, array(':form')); ?> + + widget($form['age']) ?> + +When the ``form.age`` widget is rendered, Symfony will use the customized +``integer_widget.html.php`` template and the ``input`` tag will be wrapped in +the ``div`` element. + +If you want to apply a theme to a specific child form, pass it to the ``setTheme()`` +method:: + + setTheme($form['child'], ':form'); ?> + +.. note:: + + The ``:form`` syntax is based on the functional names for templates: + ``Bundle:Directory``. As the form directory lives in the + ``app/Resources/views`` directory, the ``Bundle`` part is empty, resulting + in ``:form``. + +Making Application-wide Customizations +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you'd like a certain form customization to be global to your application, +you can accomplish this by making the form customizations in an external +template and then importing it inside your application configuration. + +By using the following configuration, any customized form fragments inside the +``app/Resources/views/Form`` folder will be used globally when a +form is rendered. + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + framework: + templating: + form: + resources: + - 'AppBundle:Form' + # ... + + .. code-block:: xml + + + + + + + + + AppBundle:Form + + + + + + + .. code-block:: php + + // app/config/config.php + // PHP + $container->loadFromExtension('framework', array( + 'templating' => array( + 'form' => array( + 'resources' => array( + 'AppBundle:Form', + ), + ), + ), + + // ... + )); + +By default, the PHP engine uses a *div* layout when rendering forms. Some people, +however, may prefer to render forms in a *table* layout. Use the ``FrameworkBundle:FormTable`` +resource to use such a layout: + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + framework: + templating: + form: + resources: + - 'FrameworkBundle:FormTable' + + .. code-block:: xml + + + + + + + + + FrameworkBundle:FormTable + + + + + + + .. code-block:: php + + // app/config/config.php + $container->loadFromExtension('framework', array( + 'templating' => array( + 'form' => array( + 'resources' => array( + 'FrameworkBundle:FormTable', + ), + ), + ), + + // ... + )); + +If you only want to make the change in one template, add the following line to +your template file rather than adding the template as a resource: + +.. code-block:: html+php + + setTheme($form, array('FrameworkBundle:FormTable')); ?> + +Note that the ``$form`` variable in the above code is the form view variable +that you passed to your template. + +Adding a "Required" Asterisk to Field Labels +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you want to denote all of your required fields with a required asterisk +(``*``), you can do this by customizing the ``form_label`` fragment. + +When using PHP as a templating engine you have to copy the content from the +original template: + +.. code-block:: html+php + + + + + + + humanize($name); } ?> + + + + + * + + +Adding "help" Messages +~~~~~~~~~~~~~~~~~~~~~~ + +You can also customize your form widgets to have an optional "help" message. + +When using PHP as a templating engine you have to copy the content from the +original template: + +.. code-block:: html+php + + + + + value="escape($value) ?>" + block($form, 'widget_attributes') ?> + /> + + + + escape($help) ?> + + .. _`@Template`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/view From e968f2950bf0cad54fa0ea93a92328821eefc8ec Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 18 Jul 2018 17:00:44 +0200 Subject: [PATCH 08/26] Replace entry/section by "article" --- security/api_key_authentication.rst | 0 security/custom_password_authenticator.rst | 0 security/custom_provider.rst | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 security/api_key_authentication.rst create mode 100644 security/custom_password_authenticator.rst create mode 100644 security/custom_provider.rst diff --git a/security/api_key_authentication.rst b/security/api_key_authentication.rst new file mode 100644 index 00000000000..e69de29bb2d diff --git a/security/custom_password_authenticator.rst b/security/custom_password_authenticator.rst new file mode 100644 index 00000000000..e69de29bb2d diff --git a/security/custom_provider.rst b/security/custom_provider.rst new file mode 100644 index 00000000000..e69de29bb2d From c3374a8ef6d4194d86f74195cf52199029fb39bd Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 27 Jul 2018 10:22:54 -0400 Subject: [PATCH 09/26] [WCM] Updating the Encore documentation + New recipe --- frontend/encore/installation-no-flex.rst | 100 +++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 frontend/encore/installation-no-flex.rst diff --git a/frontend/encore/installation-no-flex.rst b/frontend/encore/installation-no-flex.rst new file mode 100644 index 00000000000..c495ebdc968 --- /dev/null +++ b/frontend/encore/installation-no-flex.rst @@ -0,0 +1,100 @@ +Encore Installation (without Symfony Flex) +========================================== + +.. tip: + + If your project uses Symfony Flex, read :doc:`/frontend/encore/installation` + for easier instructions. + +Installing Encore +----------------- + +Install Encore into your project via Yarn: + +.. code-block:: terminal + + $ yarn add @symfony/webpack-encore --dev + +.. note:: + + If you prefer to use `npm`_, no problem! Run ``npm install @symfony/webpack-encore --save-dev``. + +This command creates (or modifies) a ``package.json`` file and downloads dependencies +into a ``node_modules/`` directory. Yarn also creates/updates a ``yarn.lock`` +(called ``package-lock.json`` if you use npm version 5+). + +.. tip:: + + You *should* commit ``package.json`` and ``yarn.lock`` (or ``package-lock.json`` + if using npm 5) to version control, but ignore ``node_modules/``. + +Creating the webpack.config.js File +----------------------------------- + +Next, create a new ``webpack.config.js`` file at the root of your project: + +.. code-block:: js + + var Encore = require('@symfony/webpack-encore'); + + Encore + // directory where compiled assets will be stored + .setOutputPath('public/build/') + // public path used by the web server to access the output path + .setPublicPath('/build') + // only needed for CDN's or sub-directory deploy + //.setManifestKeyPrefix('build/') + + /* + * ENTRY CONFIG + * + * Add 1 entry for each "page" of your app + * (including one that's included on every page - e.g. "app") + * + * Each entry will result in one JavaScript file (e.g. app.js) + * and one CSS file (e.g. app.css) if you JavaScript imports CSS. + */ + .addEntry('app', './assets/js/app.js') + //.addEntry('page1', './assets/js/page1.js') + //.addEntry('page2', './assets/js/page2.js') + + .cleanupOutputBeforeBuild() + .enableSourceMaps(!Encore.isProduction()) + // enables hashed filenames (e.g. app.abc123.css) + .enableVersioning(Encore.isProduction()) + + // uncomment if you use TypeScript + //.enableTypeScriptLoader() + + // uncomment if you use Sass/SCSS files + //.enableSassLoader() + + // uncomment if you're having problems with a jQuery plugin + //.autoProvidejQuery() + ; + + module.exports = Encore.getWebpackConfig(); + +Next, create a new ``assets/js/app.js`` file with some basic JavaScript *and* +import some JavaScript: + +.. code-block:: javascript + + // assets/js/app.js + + require('../css/app.css'); + + console.log('Hello Webpack Encore'); + +And the new ``assets/css/app.css`` file: + +.. code-block:: css + + // assets/css/app.css + body { + background-color: lightgray; + } + +You'll customize and learn more about these file in :doc:`/frontend/encore/simple-example`. + +.. _`npm`: https://www.npmjs.com/ From 509e1721fa979a7c79aa5f7863ba36d060d26952 Mon Sep 17 00:00:00 2001 From: Daniel West Date: Tue, 28 Nov 2017 16:25:58 +0000 Subject: [PATCH 10/26] ! prefix referencing templates --- templating.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templating.rst b/templating.rst index 72c2eb068d5..a23951b7a61 100644 --- a/templating.rst +++ b/templating.rst @@ -367,6 +367,9 @@ for several types of templates, each which lives in a specific location: Using this namespaced syntax instead of the real file paths allows applications to :ref:`override templates that live inside any bundle `. +If you have overridden a template, you can use the "!" prefix to refer to the original bundle's +template. E.g. ``@!AcmeBlog/layout.html.twig`` + Template Suffix ~~~~~~~~~~~~~~~ From d6ed611f42964623a6e7e937e3b30331a540ef09 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 6 Sep 2018 17:58:27 +0200 Subject: [PATCH 11/26] Reworded the explanation --- templating.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/templating.rst b/templating.rst index a23951b7a61..72c2eb068d5 100644 --- a/templating.rst +++ b/templating.rst @@ -367,9 +367,6 @@ for several types of templates, each which lives in a specific location: Using this namespaced syntax instead of the real file paths allows applications to :ref:`override templates that live inside any bundle `. -If you have overridden a template, you can use the "!" prefix to refer to the original bundle's -template. E.g. ``@!AcmeBlog/layout.html.twig`` - Template Suffix ~~~~~~~~~~~~~~~ From ae00e6edf2f05c4a69405c6f6daef841f9fffb8c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 17 Sep 2018 19:22:19 +0200 Subject: [PATCH 12/26] Fixed Encore dir paths --- frontend/encore/installation-no-flex.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/encore/installation-no-flex.rst b/frontend/encore/installation-no-flex.rst index c495ebdc968..c6821af9ad5 100644 --- a/frontend/encore/installation-no-flex.rst +++ b/frontend/encore/installation-no-flex.rst @@ -17,7 +17,7 @@ Install Encore into your project via Yarn: .. note:: - If you prefer to use `npm`_, no problem! Run ``npm install @symfony/webpack-encore --save-dev``. + If you prefer to use `npm`_, no problem! Run ``npm install @symfony/webpack-encore --save-dev``. This command creates (or modifies) a ``package.json`` file and downloads dependencies into a ``node_modules/`` directory. Yarn also creates/updates a ``yarn.lock`` @@ -81,9 +81,9 @@ import some JavaScript: .. code-block:: javascript // assets/js/app.js - + require('../css/app.css'); - + console.log('Hello Webpack Encore'); And the new ``assets/css/app.css`` file: From 2c3a8d8fb64c0f967a6ae51438bdf53480c804c3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 21 Sep 2018 09:49:14 +0200 Subject: [PATCH 13/26] Mentioned how to redirect and maintain the query string --- controller.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller.rst b/controller.rst index 78837f3f9c2..a6087ed3394 100644 --- a/controller.rst +++ b/controller.rst @@ -151,6 +151,9 @@ and ``redirect()`` methods:: // redirects to a route and maintains the original query string parameters return $this->redirectToRoute('blog_show', $request->query->all()); + // redirects to a route and mantains the original query string parameters + return $this->redirectToRoute('blog_show', $request->query->all()); + // redirects externally return $this->redirect('http://symfony.com/doc'); } From 4de86fea1cca069fff82770f2db73039d8fdad4d Mon Sep 17 00:00:00 2001 From: Roy Klutman Date: Fri, 21 Sep 2018 19:45:44 +0200 Subject: [PATCH 14/26] Remove unnecessary semicolons --- templating/PHP.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templating/PHP.rst b/templating/PHP.rst index d561f79488e..e2d1ec0f93d 100644 --- a/templating/PHP.rst +++ b/templating/PHP.rst @@ -588,7 +588,7 @@ Now that you've created the customized form template, you need to tell Symfony to use it. Inside the template where you're actually rendering your form, tell Symfony to use the theme via the ``setTheme()`` helper method:: - setTheme($form, array(':form')); ?> + setTheme($form, array(':form')) ?> widget($form['age']) ?> @@ -599,7 +599,7 @@ the ``div`` element. If you want to apply a theme to a specific child form, pass it to the ``setTheme()`` method:: - setTheme($form['child'], ':form'); ?> + setTheme($form['child'], ':form') ?> .. note:: @@ -726,7 +726,7 @@ your template file rather than adding the template as a resource: .. code-block:: html+php - setTheme($form, array('FrameworkBundle:FormTable')); ?> + setTheme($form, array('FrameworkBundle:FormTable')) ?> Note that the ``$form`` variable in the above code is the form view variable that you passed to your template. From ff1246a53cc56225440d9bb71665bf4f8b528c7f Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Wed, 10 Oct 2018 09:21:05 +0200 Subject: [PATCH 15/26] feat(emails): async emails Small addition in order to explain how the messenger can be used in order to send emails asynchronously using a message broker. Need to be reviewed for syntax and sentences. --- messenger.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/messenger.rst b/messenger.rst index c5b1971630f..f9d3a5f45cc 100644 --- a/messenger.rst +++ b/messenger.rst @@ -437,6 +437,50 @@ while still having them passed to their respective handler: ], ]); +Asynchronous emails +------------------- + +A lot of modern apps need to send emails using a message broker (RabbitMQ for example), +for now, you know how to dispatch a message and handle it, before sending any email message, +time for a quick reminder, in a normal "web" application, +Symfony handle the spool during the ``kernel.terminate`` event, problem is, +during a message handling, this event isn't dispatched. + +The first thing to change is the SwiftMailer configuration: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/swiftmailer.yaml + swiftmailer: + # spool: { type: 'memory' } + + .. code-block:: xml + + + + + + + + + .. code-block:: php + + // config/packages/messenger.php + $container->loadFromExtension('swiftmailer', array( + // ... Other keys expect the spool one. + )); + +The key here is to tell Switmailer to not use the spool (as explained earlier), +this way, the message can be consumed directly by the handler and sent. + Consuming Messages ------------------ From 5644a1aa18dfe13c643c3e7f19f33aba973e5541 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Wed, 10 Oct 2018 09:24:47 +0200 Subject: [PATCH 16/26] fix(syntax): fix on line --- messenger.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/messenger.rst b/messenger.rst index f9d3a5f45cc..f517ab96c24 100644 --- a/messenger.rst +++ b/messenger.rst @@ -457,6 +457,7 @@ The first thing to change is the SwiftMailer configuration: # spool: { type: 'memory' } .. code-block:: xml + Date: Wed, 10 Oct 2018 09:27:36 +0200 Subject: [PATCH 17/26] fix(syntax): fix on indentation --- messenger.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/messenger.rst b/messenger.rst index f517ab96c24..557d8597838 100644 --- a/messenger.rst +++ b/messenger.rst @@ -458,19 +458,19 @@ The first thing to change is the SwiftMailer configuration: .. code-block:: xml - - - - - - - + + + + + + + .. code-block:: php From 63eedef46f499f72dc899611ac07e1bf0ce6c3b6 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Fri, 19 Oct 2018 17:24:16 +0200 Subject: [PATCH 18/26] fix(async): async emails Fix on the bloc name, moved to a tip. --- messenger.rst | 64 +++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/messenger.rst b/messenger.rst index 557d8597838..7913281d949 100644 --- a/messenger.rst +++ b/messenger.rst @@ -437,50 +437,44 @@ while still having them passed to their respective handler: ], ]); -Asynchronous emails -------------------- +.. tip:: -A lot of modern apps need to send emails using a message broker (RabbitMQ for example), -for now, you know how to dispatch a message and handle it, before sending any email message, -time for a quick reminder, in a normal "web" application, -Symfony handle the spool during the ``kernel.terminate`` event, problem is, -during a message handling, this event isn't dispatched. + If you need to send asynchronous emails, it could be usefull to deactivate + the spool as it's only called during the ``kernel.terminate`` event (which + is not dispatched during command call). -The first thing to change is the SwiftMailer configuration: + The first thing to change is the SwiftMailer configuration: -.. configuration-block:: + .. configuration-block:: - .. code-block:: yaml + .. code-block:: yaml - # config/packages/swiftmailer.yaml - swiftmailer: - # spool: { type: 'memory' } - - .. code-block:: xml - - - + # config/packages/swiftmailer.yaml + swiftmailer: + # spool: { type: 'memory' } - - - - + .. code-block:: xml - .. code-block:: php + + - // config/packages/messenger.php - $container->loadFromExtension('swiftmailer', array( - // ... Other keys expect the spool one. - )); + + + + + + .. code-block:: php -The key here is to tell Switmailer to not use the spool (as explained earlier), -this way, the message can be consumed directly by the handler and sent. + // config/packages/messenger.php + $container->loadFromExtension('swiftmailer', array( + // ... Other keys expect the spool one. + )); Consuming Messages ------------------ From 91b96c59cb3d464872967fc9da66b9103af9cb0b Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Sun, 21 Oct 2018 18:53:40 +0200 Subject: [PATCH 19/26] feat(message): example for email message --- messenger.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/messenger.rst b/messenger.rst index 7913281d949..7193e346ebe 100644 --- a/messenger.rst +++ b/messenger.rst @@ -475,6 +475,13 @@ while still having them passed to their respective handler: $container->loadFromExtension('swiftmailer', array( // ... Other keys expect the spool one. )); + + Then time to send your message which contain the email content: + + .. code-block:: php + + $this->messageBus->dispatch(new EmailMessage('...'); + Consuming Messages ------------------ From 9cb78f4fa3b40d50842263df27ccb3cb3ba17ae8 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Sun, 21 Oct 2018 18:54:09 +0200 Subject: [PATCH 20/26] fix(syntax): fix on indentation --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index 7193e346ebe..d8930032fea 100644 --- a/messenger.rst +++ b/messenger.rst @@ -480,7 +480,7 @@ while still having them passed to their respective handler: .. code-block:: php - $this->messageBus->dispatch(new EmailMessage('...'); + $this->messageBus->dispatch(new EmailMessage('...'); Consuming Messages From c14aa961e03707e6773662111863112a2f160003 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Sun, 21 Oct 2018 18:56:34 +0200 Subject: [PATCH 21/26] fix(syntax): fix on parentheses Small fix on the MessageBus parentheses call. --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index d8930032fea..6be8b874ded 100644 --- a/messenger.rst +++ b/messenger.rst @@ -480,7 +480,7 @@ while still having them passed to their respective handler: .. code-block:: php - $this->messageBus->dispatch(new EmailMessage('...'); + $this->messageBus->dispatch(new EmailMessage('...')); Consuming Messages From e3cada80a70cdb82f3a1cddacb35c4a2e7c32877 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Mon, 11 Feb 2019 17:45:42 +0100 Subject: [PATCH 22/26] fix(sentence): fix on first usage --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index 6be8b874ded..399d1d8b3aa 100644 --- a/messenger.rst +++ b/messenger.rst @@ -443,7 +443,7 @@ while still having them passed to their respective handler: the spool as it's only called during the ``kernel.terminate`` event (which is not dispatched during command call). - The first thing to change is the SwiftMailer configuration: + To do so, update the SwiftMailer configuration: .. configuration-block:: From 3d59bcfe93e35856c482ac938df6ff9975bb1bce Mon Sep 17 00:00:00 2001 From: Vincent Le Biannic <850046+Lyrkan@users.noreply.github.com> Date: Tue, 12 Feb 2019 10:35:02 +0100 Subject: [PATCH 23/26] fix(wording): fix on spool exception Co-Authored-By: Guikingone --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index 399d1d8b3aa..e5aa1f437f5 100644 --- a/messenger.rst +++ b/messenger.rst @@ -465,7 +465,7 @@ while still having them passed to their respective handler: http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> - + From 1d7a91c135add05d3680b575f76b975c55244d88 Mon Sep 17 00:00:00 2001 From: Vincent Le Biannic <850046+Lyrkan@users.noreply.github.com> Date: Tue, 12 Feb 2019 10:35:34 +0100 Subject: [PATCH 24/26] fix(wording): fix on spool exception (php version) Co-Authored-By: Guikingone --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index e5aa1f437f5..621bf526527 100644 --- a/messenger.rst +++ b/messenger.rst @@ -473,7 +473,7 @@ while still having them passed to their respective handler: // config/packages/messenger.php $container->loadFromExtension('swiftmailer', array( - // ... Other keys expect the spool one. + // ... Other keys except the spool one. )); Then time to send your message which contain the email content: From e141c54c8f853205d1a9a152c21fffe62772af5f Mon Sep 17 00:00:00 2001 From: Vincent Le Biannic <850046+Lyrkan@users.noreply.github.com> Date: Tue, 12 Feb 2019 10:36:07 +0100 Subject: [PATCH 25/26] fix(wording): fix on spool usage Co-Authored-By: Guikingone --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index 621bf526527..cf28e07bfd2 100644 --- a/messenger.rst +++ b/messenger.rst @@ -439,7 +439,7 @@ while still having them passed to their respective handler: .. tip:: - If you need to send asynchronous emails, it could be usefull to deactivate + If you need to send asynchronous emails, it could be useful to deactivate the spool as it's only called during the ``kernel.terminate`` event (which is not dispatched during command call). From 8b7856f19d7d6153f2fe91d8d28183e23f7ccc1b Mon Sep 17 00:00:00 2001 From: Vincent Le Biannic <850046+Lyrkan@users.noreply.github.com> Date: Tue, 12 Feb 2019 10:36:31 +0100 Subject: [PATCH 26/26] fix(wording): fix on message content Co-Authored-By: Guikingone --- messenger.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messenger.rst b/messenger.rst index cf28e07bfd2..e8adcab5510 100644 --- a/messenger.rst +++ b/messenger.rst @@ -476,7 +476,7 @@ while still having them passed to their respective handler: // ... Other keys except the spool one. )); - Then time to send your message which contain the email content: + Then time to send your message which contains the email content: .. code-block:: php