Allows customization of Messages on-the-fly.
package | Swift |
---|---|
subpackage | Plugins |
author | Chris Corbyn |
author | Fabien Potencier |
__construct(mixed $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
Array or Swift_Plugins_Decorator_Replacements
beforeSendPerformed(\Swift_Events_SendEvent $evt)
getReplacementsFor(string $address) : array
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
array
sendPerformed(\Swift_Events_SendEvent $evt)
setReplacements(mixed $replacements)
_restoreMessage(\Swift_Mime_Message $message)
$_lastMessage
$_originalBody
$_originalChildBodies
$_originalHeaders
$_replacements