\Swift_Plugins_DecoratorPlugin
Allows customization of Messages on-the-fly.
- Author: Chris Corbyn
Synopsis
class Swift_Plugins_DecoratorPlugin
implements
Swift_Events_SendListener,Swift_Plugins_Decorator_Replacements
{
- // members
- private $_replacements;
- private $_originalBody;
- private array $_originalHeaders;
- private array $_originalChildBodies;
- private $_lastMessage;
- // methods
- public void __construct()
- public void setReplacements()
- public void beforeSendPerformed()
- public array getReplacementsFor()
- public void sendPerformed()
- private void _restoreMessage()
Hierarchy
Members
private
-
$_lastMessage
The Message that was last replaced -
$_originalBody
The body as it was before replacements -
$_originalChildBodies
Bodies of children before they are replaced -
$_originalHeaders
The original headers of the message, before replacements -
$_replacements
The replacement map
Methods
private
- _restoreMessage() — Restore a changed message back to its original state
public
- __construct() — Create a new DecoratorPlugin with $replacements.
- beforeSendPerformed() — Invoked immediately before the Message is sent.
- getReplacementsFor() — Find a map of replacements for the address.
- sendPerformed() — Invoked immediately after the Message is sent.
- setReplacements() — Sets replacements.