TYPO3  7.6
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Swift_Plugins_RedirectingPlugin Class Reference
Inheritance diagram for Swift_Plugins_RedirectingPlugin:
Swift_Events_SendListener Swift_Events_EventListener

Public Member Functions

 __construct ($recipient, array $whitelist=array())
 
 setRecipient ($recipient)
 
 getRecipient ()
 
 setWhitelist (array $whitelist)
 
 getWhitelist ()
 
 beforeSendPerformed (Swift_Events_SendEvent $evt)
 
 sendPerformed (Swift_Events_SendEvent $evt)
 

Protected Member Functions

 _isWhitelisted ($recipient)
 

Private Member Functions

 _filterHeaderSet (Swift_Mime_HeaderSet $headerSet, $type)
 
 _filterNameAddresses (array $recipients)
 
 _restoreMessage (Swift_Mime_Message $message)
 

Private Attributes

 $_recipient
 
 $_whitelist = array()
 

Detailed Description

Redirects all email to a single recipient.

Author
Fabien Potencier

Definition at line 16 of file RedirectingPlugin.php.

Constructor & Destructor Documentation

__construct (   $recipient,
array  $whitelist = array() 
)

Create a new RedirectingPlugin.

Parameters
mixed$recipient
array$whitelist

Definition at line 38 of file RedirectingPlugin.php.

Member Function Documentation

_filterHeaderSet ( Swift_Mime_HeaderSet  $headerSet,
  $type 
)
private

Filter header set against a whitelist of regular expressions.

Parameters
Swift_Mime_HeaderSet$headerSet
string$type

Definition at line 132 of file RedirectingPlugin.php.

References _filterNameAddresses(), and Swift_Mime_HeaderSet\getAll().

Referenced by beforeSendPerformed().

_filterNameAddresses ( array  $recipients)
private

Filtered list of addresses => name pairs.

Parameters
array$recipients
Returns
array

Definition at line 146 of file RedirectingPlugin.php.

References _isWhitelisted().

Referenced by _filterHeaderSet().

_isWhitelisted (   $recipient)
protected

Matches address against whitelist of regular expressions.

Parameters
$recipient
Returns
bool

Definition at line 166 of file RedirectingPlugin.php.

Referenced by _filterNameAddresses().

_restoreMessage ( Swift_Mime_Message  $message)
private
beforeSendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately before the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 89 of file RedirectingPlugin.php.

References _filterHeaderSet(), and Swift_Events_SendEvent\getMessage().

getRecipient ( )

Get the recipient of all messages.

Returns
mixed

Definition at line 59 of file RedirectingPlugin.php.

References $_recipient.

getWhitelist ( )

Get the whitelist.

Returns
array

Definition at line 79 of file RedirectingPlugin.php.

References $_whitelist.

sendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately after the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 186 of file RedirectingPlugin.php.

References _restoreMessage(), and Swift_Events_SendEvent\getMessage().

setRecipient (   $recipient)

Set the recipient of all messages.

Parameters
mixed$recipient

Definition at line 49 of file RedirectingPlugin.php.

setWhitelist ( array  $whitelist)

Set a list of regular expressions to whitelist certain recipients.

Parameters
array$whitelist

Definition at line 69 of file RedirectingPlugin.php.

Member Data Documentation

$_recipient
private

Definition at line 23 of file RedirectingPlugin.php.

Referenced by getRecipient().

$_whitelist = array()
private

Definition at line 30 of file RedirectingPlugin.php.

Referenced by getWhitelist().