Class Swift_BatchMailer

Description

Handles batch mailing with Swift Mailer with fail-safe support.

Restarts the connection if it dies and then continues where it left off. Please read the LICENSE file

  • license: GNU
  • author: Chris Corbyn <chris@w3style.co.uk>
  • copyright: Chris Corbyn <chris@w3style.co.uk>

Located in /Swift/BatchMailer.php (line 12)


	
			
Variable Summary
Method Summary
Swift_BatchMailer __construct (Swift $swift)
void addFailedRecipient (string $address)
void copyMessageHeaders (Swift_Message &$message)
int getMaxTries ()
int getSleepTime ()
int send ( $message, Swift_RecipientList $recipients, Swift_Address $sender)
void setMaxSuccessiveFailures (int $fails)
void setMaxTries (int $max)
void setSleepTime (int $secs)
void setSwift (Swift $swift)
Variables
array $failed = array() (line 33)

Failed recipients (undeliverable)

  • access: protected
array $headers = array() (line 43)

A temporary copy of some message headers.

  • access: protected
int $maxFails = 0 (line 38)

The maximum number of successive failures before giving up.

  • access: protected
int $maxTries = 2 (line 23)

The maximum number of times a single recipient can be attempted before giving up.

  • access: protected
int $sleepTime = 0 (line 28)

The number of seconds to sleep for if an error occurs.

  • access: protected
Swift $swift (line 18)

The current instance of Swift.

  • access: protected
Methods
Constructor __construct (line 49)

Constructor.

  • access: public
Swift_BatchMailer __construct (Swift $swift)
  • Swift $swift: The current instance of Swift
addFailedRecipient (line 105)

Log a failed recipient.

  • access: public
void addFailedRecipient (string $address)
  • string $address: The email address.
copyMessageHeaders (line 158)

Takes a temporary copy of original message headers in case an error occurs and they need restoring.

  • access: protected
void copyMessageHeaders (Swift_Message &$message)
flushFailedRecipients (line 121)

Clear out the list of failed recipients.

  • access: public
void flushFailedRecipients ()
forceRestartSwift (line 145)

Restarts Swift forcibly.

  • access: protected
void forceRestartSwift ()
getFailedRecipients (line 114)

Get all recipients which failed in this batch.

  • access: public
array getFailedRecipients ()
getMaxSuccessiveFailures (line 138)

Get the maximum number of times an error can be thrown and still be hidden.

  • access: public
int getMaxSuccessiveFailures ()
getMaxTries (line 81)

Get the number of times a single address will be attempted in a batch.

  • access: public
int getMaxTries ()
getSleepTime (line 97)

Get the amount of time to sleep for on errors.

  • access: public
int getSleepTime ()
getSwift (line 65)

Get the Swift instance which is running.

  • access: public
Swift getSwift ()
restoreMessageHeaders (line 173)

Restore message headers to original values in the event of a failure.

  • access: protected
void restoreMessageHeaders (Swift_Message &$message)
send (line 188)

Run a batch send in a fail-safe manner.

This operates as Swift::batchSend() except it deals with errors itself.

  • return: The number sent to
  • access: public
int send ( $message, Swift_RecipientList $recipients, Swift_Address $sender)
setMaxSuccessiveFailures (line 130)

Set the maximum number of times an error can be thrown in succession and still be hidden.

  • access: public
void setMaxSuccessiveFailures (int $fails)
  • int $fails
setMaxTries (line 73)

Set the maximum number of times a single address is allowed to be retried.

  • access: public
void setMaxTries (int $max)
  • int $max: The maximum number of tries.
setSleepTime (line 89)

Set the amount of time to sleep for if an error occurs.

  • access: public
void setSleepTime (int $secs)
  • int $secs: Number of seconds
setSwift (line 57)

Set the current Swift instance.

  • access: public
void setSwift (Swift $swift)
  • Swift $swift: The instance

Documentation generated on Wed, 26 Mar 2008 20:33:03 +1100 by phpDocumentor 1.3.1