Campaign message sender

package org.openpsa.directmarketing

 Methods

__construct (\org_openpsa_directmarketing_campaign_message_dba $message, array $config)

Parameters

$message

\org_openpsa_directmarketing_campaign_message_dbaThe message we're working on

$config

arrayConfiguration that gets handed to the backend

get_status ()

Get send status

Returns

arrayNumber of valid members at index 0 and number of send receipts at 1

send ($subject, $content, $from)

Sends a message to all applicable members

Parameters

$subject

$content

$from

send_bg ($url_base, $batch, $content, $from, $subject)

Sends $content to all members of the campaign

Parameters

$url_base

$batch

$content

$from

$subject

_qb_common_constraints ($qb)

Sets the common constrains for campaign members queries

Parameters

$qb

_check_campaign_up_to_date ()

Check if this message is attached to a smart campaign, if so update the campaign members

_create_token ()

Creates a random token string that can be used to track a single delivery.

The returned token string will only contain lowercase alphanumeric characters and will start with a lowercase letter to avoid problems with special processing being triggered by special characters in the token string.

Returns

\randomtoken string

_get_person (object $member)

Check is given member has denied contacts of given type

Parameters

$member

objectreference to campaign_member object related to the person

Returns

mixedorg_openpsa_contacts_person_dba person on success, false if denied

_qb_chunk_limits ($qb)

Parameters

$qb

_qb_filter_results ($results)

Parameters

$results

_qb_send_loop ()

Loops trough send filter in chunks, adds some common constraints and checks for send-receipts.

_qb_single_chunk ($level)

Parameters

$level

_send_member (\org_openpsa_directmarketing_campaign_member_dba $member, $subject, $content, $from)

Parameters

$member

$subject

$content

$from

 Properties

 

integer $chunk_size

How many messages to send in one go
 

boolean $send_output

Should output be shown
 

boolean $test_mode

Are we running in test mode
 

integer $token_size

Length of the message token
 

\org_openpsa_directmarketing_sender_backend $_backend

The backend to use
 

integer $_chunk_max_recurse

How many times to recurse if all results are filtered (speed vs memory [and risk on crashing], higher is faster)
 

mixed $_chunk_num

 

\org_openpsa_directmarketing_campaign_message_dba $_message

The message we're working on
 

integer $_messages_sent

Tracks total number of sent messages