Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
09e21e66
Commit
09e21e66
authored
Mar 04, 2014
by
Javier Eguiluz
Committed by
Fabien Potencier
Mar 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a note about how to send emails with console commands
parent
235c4950
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
doc/providers/swiftmailer.rst
doc/providers/swiftmailer.rst
+16
-0
No files found.
doc/providers/swiftmailer.rst
View file @
09e21e66
...
...
@@ -97,6 +97,22 @@ The Swiftmailer provider provides a ``mailer`` service::
return new Response('Thank you for your feedback!', 201);
});
Usage in commands
~~~~~~~~~~~~~~~~~
The Swiftmailer provider sends the emails using the ``KernelEvents::TERMINATE``
event, which is fired after the response has been sent. However, as this event
isn't fired for console commands, your emails won't be sent.
For that reason, if you send emails using a command console, make sure to
flush the message spool by hand before ending the command execution. To do so,
use the following code::
$app['swiftmailer.spooltransport']
->getSpool()
->flushQueue($app['swiftmailer.transport'])
;
Traits
------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment