Class CampaignMailingBehavior
Behavior class for email delivery in email marketing campaigns.
Static methods are used for batch emailing; all non-static methods assume that an individual email is being sent.
- CComponent
- CBehavior implements IBehavior
- EmailDeliveryBehavior
- CampaignMailingBehavior
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/modules/marketing/components/CampaignMailingBehavior.php
public static
type
|
#
prepareEmail(
Prepares the subject and body of a campaign email. |
public static
|
|
public static
|
|
public static
|
|
public static
array
|
#
deliverableItems( integer $listId, boolean $unsent = false )
For a given list ID, find all contact/list item entries such that sending is possible, is permissible, or has happened. |
public static
|
|
public
type
|
|
public
type
|
|
public
|
|
public
|
|
public
|
|
public
type
|
|
public
boolean
|
#
mailIsStillDeliverable( )
One final check for whether the mail should be sent, and enable the 'sending' flag. |
public
|
#
markEmailSent( type $uniqueId, boolean $sent = true )
Records the date of delivery and marks the list record with the unique id. |
public
|
|
public
|
|
public static
|
|
protected static
Array
|
attach(),
detach(),
events(),
getEnabled(),
getOwner(),
setEnabled()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
string |
EMLLOCK
|
'campaign_emailing.lock' |
#
Filename of lock file in protected/runtime, to signal that emailing is already in progress and other processes should not attempt to send email (as this may result in race conditions and duplicate emails) |
integer |
STATE_BULKLIMIT
|
1 |
#
Error code for the bulk limit being reached |
integer |
STATE_RACECOND
|
2 |
#
Error code for an email already sending. |
integer |
STATE_NULLADDRESS
|
3 |
#
Error code for an item whose address has suddenly gone blank |
integer |
STATE_DONOTEMAIL
|
4 |
#
Error code for an unsubscribed / do-not-email contact |
integer |
STATE_SENT
|
5 |
#
Error code for another email process beating us to the punch |
public static
type
|
$batchTime |
|
#
Stores the time that the batch operation started (when calling this class' methods statically) |
public
|
$_campaign |
|
#
The current campaign model being operated on |
public
type
|
$fullStop | false |
#
Whether the campaign mailing process should halt as soon as possible |
public
integer
|
$itemId |
|
#
The ID of the campaign list item corresponding to the current recipient. |
public
boolean
|
$stateChange | false |
#
Indicates whether the mail cannot be sent due to a recent change in the list item or contact record. |
public
integer
|
$stateChangeType | 0 |
#
Indicates the type of state change that should block email delivery. This
purpose is not relegated to |
public
boolean
|
$undeliverable | false |
#
Whether the current email could not be delivered due to bad RCPT or something that's not a critical PHPMailer error |
$status
|
public
|
$campaign |
#
Campaign model for the current email |
public
boolean
|
$isNewsletter |
#
True if sending to a newsletter list (not a contacts list) |
public
|
$list |
#
The list corresponding to the current campaign being operated on |
public
|
$listItem |
#
List item of the |
public
|
$recipient |
#
The contact of the current recipient that the email is being sent to. If it's not a campaign, but a newsletter, this will be an ad-hoc contact model with its email address set to that of the list item. |
$credentials,
$from,
$mailer,
$userProfile
|
$enabled,
$owner
|