![]() |
TYPO3
7.6
|
Public Member Functions | |
__construct ($replacements) | |
setReplacements ($replacements) | |
beforeSendPerformed (Swift_Events_SendEvent $evt) | |
getReplacementsFor ($address) | |
sendPerformed (Swift_Events_SendEvent $evt) | |
Private Member Functions | |
_restoreMessage (Swift_Mime_Message $message) | |
Private Attributes | |
$_replacements | |
$_originalBody | |
$_originalHeaders = array() | |
$_originalChildBodies = array() | |
$_lastMessage | |
Allows customization of Messages on-the-fly.
Definition at line 17 of file DecoratorPlugin.php.
__construct | ( | $replacements | ) |
Create a new DecoratorPlugin with $replacements.
The $replacements can either be an associative array, or an implementation of Swift_Plugins_Decorator_Replacements.
When using an array, it should be of the form: $replacements = array( "address1@domain.tld" => array("{a}" => "b", "{c}" => "d"), "address2@domain.tld" => array("{a}" => "x", "{c}" => "y") )
When using an instance of Swift_Plugins_Decorator_Replacements, the object should return just the array of replacements for the address given to Swift_Plugins_Decorator_Replacements::getReplacementsFor().
mixed | $replacements | Array or Swift_Plugins_Decorator_Replacements |
Definition at line 54 of file DecoratorPlugin.php.
References setReplacements().
|
private |
Restore a changed message back to its original state
Definition at line 179 of file DecoratorPlugin.php.
References $_originalHeaders, Swift_Mime_MimeEntity\getChildren(), Swift_Mime_MimeEntity\getHeaders(), and Swift_Mime_MimeEntity\setBody().
Referenced by beforeSendPerformed(), and sendPerformed().
beforeSendPerformed | ( | Swift_Events_SendEvent | $evt | ) |
Invoked immediately before the Message is sent.
Swift_Events_SendEvent | $evt |
Implements Swift_Events_SendListener.
Definition at line 80 of file DecoratorPlugin.php.
References _restoreMessage(), Swift_Events_SendEvent\getMessage(), and getReplacementsFor().
getReplacementsFor | ( | $address | ) |
Find a map of replacements for the address.
If this plugin was provided with a delegate instance of Swift_Plugins_Decorator_Replacements then the call will be delegated to it. Otherwise, it will attempt to find the replacements from the array provided in the constructor.
If no replacements can be found, an empty value (NULL) is returned.
string | $address |
Implements Swift_Plugins_Decorator_Replacements.
Definition at line 156 of file DecoratorPlugin.php.
Referenced by beforeSendPerformed().
sendPerformed | ( | Swift_Events_SendEvent | $evt | ) |
Invoked immediately after the Message is sent.
Swift_Events_SendEvent | $evt |
Implements Swift_Events_SendListener.
Definition at line 173 of file DecoratorPlugin.php.
References _restoreMessage(), and Swift_Events_SendEvent\getMessage().
setReplacements | ( | $replacements | ) |
Sets replacements.
mixed | $replacements | Array or Swift_Plugins_Decorator_Replacements |
Definition at line 66 of file DecoratorPlugin.php.
Referenced by __construct().
|
private |
The Message that was last replaced
Definition at line 32 of file DecoratorPlugin.php.
|
private |
The body as it was before replacements
Definition at line 23 of file DecoratorPlugin.php.
|
private |
Bodies of children before they are replaced
Definition at line 29 of file DecoratorPlugin.php.
|
private |
The original headers of the message, before replacements
Definition at line 26 of file DecoratorPlugin.php.
Referenced by _restoreMessage().
|
private |
The replacement map
Definition at line 20 of file DecoratorPlugin.php.