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
cbe94829
Commit
cbe94829
authored
Jun 13, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added sender_address to switfmailer provider
parent
ebe7e78f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
doc/providers/swiftmailer.rst
doc/providers/swiftmailer.rst
+4
-0
src/Silex/Provider/SwiftmailerServiceProvider.php
src/Silex/Provider/SwiftmailerServiceProvider.php
+11
-5
No files found.
doc/providers/swiftmailer.rst
View file @
cbe94829
...
...
@@ -12,9 +12,13 @@ Parameters
* **swiftmailer.use_spool**: A boolean to specify whether or not to use the
memory spool, defaults to true.
* **swiftmailer.options**: An array of options for the default SMTP-based
configuration.
* **swiftmailer.sender_address**: If set, all messages will be delivered with
this address as the "return path" address.
The following options can be set:
* **host**: SMTP hostname, defaults to 'localhost'.
...
...
src/Silex/Provider/SwiftmailerServiceProvider.php
View file @
cbe94829
...
...
@@ -71,6 +71,10 @@ class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListe
$transport
->
setPassword
(
$options
[
'password'
]);
$transport
->
setAuthMode
(
$options
[
'auth_mode'
]);
if
(
null
!==
$app
[
'swiftmailer.sender_address'
])
{
$transport
->
registerPlugin
(
new
\Swift_Plugins_ImpersonatePlugin
(
$app
[
'swiftmailer.sender_address'
]));
}
return
$transport
;
};
...
...
@@ -89,6 +93,8 @@ class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListe
$app
[
'swiftmailer.transport.eventdispatcher'
]
=
function
()
{
return
new
\Swift_Events_SimpleEventDispatcher
();
};
$app
[
'swiftmailer.sender_address'
]
=
null
;
}
public
function
subscribe
(
Container
$app
,
EventDispatcherInterface
$dispatcher
)
...
...
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