\org_openpsa_directmarketing_sender

Campaign message sender

Note, that the request data, for ease of use, already contains the L10n Databases of the Component and MidCOM itself located in this class. They are stored as 'l10n' and 'l10n_midcom'. Also available as 'config' is the current component configuration.

Summary

Methods
Properties
Constants
__construct()
__get()
__isset()
set_active_leaf()
add_stylesheet()
get_workflow()
send()
send_bg()
register_send_job()
get_status()
$_component
$send_output
$test_mode
$chunk_size
$token_size
$_i18n
$_l10n
$_l10n_midcom
$_config
No constants found
_qb_common_constraints()
No protected properties found
N/A
process_results()
_send_member()
_create_token()
_get_person()
_qb_send_loop()
_qb_single_chunk()
_qb_chunk_limits()
_qb_filter_results()
_check_campaign_up_to_date()
$_services
$_message
$_backend
$_messages_sent
$_chunk_num
$_chunk_max_recurse
N/A

Properties

$_component

$_component : string

The name of the component, e.g. net.nehmer.static. Should be used whenever the component's name is required instead of hardcoding it.

Type

string

$send_output

$send_output : boolean

Should output be shown

Type

boolean

$test_mode

$test_mode : boolean

Are we running in test mode

Type

boolean

$chunk_size

$chunk_size : integer

How many messages to send in one go

Type

integer

$token_size

$token_size : integer

Length of the message token

Type

integer

$_i18n

$_i18n : \midcom_services_i18n

A handle to the i18n service.

Type

\midcom_services_i18n

$_l10n

$_l10n : \midcom_services_i18n_l10n

The components' L10n string database.

Type

\midcom_services_i18n_l10n

$_l10n_midcom

$_l10n_midcom : \midcom_services_i18n_l10n

The global MidCOM string database.

Type

\midcom_services_i18n_l10n

$_config

$_config : \midcom_helper_configuration

The current configuration.

Type

\midcom_helper_configuration

$_services

$_services : array

Array that holds the already instantiated services

Type

array

$_messages_sent

$_messages_sent : integer

Tracks total number of sent messages

Type

integer

$_chunk_num

$_chunk_num : 

Type

$_chunk_max_recurse

$_chunk_max_recurse : integer

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

Type

integer

Methods

__construct()

__construct(\org_openpsa_directmarketing_campaign_message_dba  $message, array  $config = array()) 

Parameters

\org_openpsa_directmarketing_campaign_message_dba $message

The message we're working on

array $config

Configuration that gets handed to the backend

__get()

__get(  $field) 

Parameters

$field

__isset()

__isset(  $field) 

Parameters

$field

set_active_leaf()

set_active_leaf(  $leaf_id) 

Parameters

$leaf_id

add_stylesheet()

add_stylesheet(string  $url, string  $media = false) 

Convenience shortcut for adding CSS files

Parameters

string $url

The stylesheet URL

string $media

The media type(s) for the stylesheet, if any

get_workflow()

get_workflow(string  $identifier, array  $options = array()) : \midcom\workflow\dialog

Parameters

string $identifier
array $options

Returns

\midcom\workflow\dialog

send()

send(  $subject,   $content,   $from) 

Sends a message to all applicable members

Parameters

$subject
$content
$from

send_bg()

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

Sends $content to all members of the campaign

Parameters

$url_base
$batch
$content
$from
$subject

register_send_job()

register_send_job(  $batch,   $url_base,   $time = null) 

Parameters

$batch
$url_base
$time

get_status()

get_status() : array

Get send status

Returns

array —

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

_qb_common_constraints()

_qb_common_constraints(  $qb) 

Sets the common constrains for campaign members queries

Parameters

$qb

process_results()

process_results(array  $results,   $subject,   $content,   $from) 

Parameters

array $results
$subject
$content
$from

_create_token()

_create_token() : string

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

string —

random token string

_get_person()

_get_person(\org_openpsa_directmarketing_campaign_member_dba  $member) : mixed

Check is given member has denied contacts of given type

Parameters

\org_openpsa_directmarketing_campaign_member_dba $member

campaign_member object related to the person

Returns

mixed —

org_openpsa_contacts_person_dba person on success, false if denied

_qb_send_loop()

_qb_send_loop() 

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

_qb_single_chunk()

_qb_single_chunk(  $level) 

Parameters

$level

_qb_chunk_limits()

_qb_chunk_limits(  $qb) 

Parameters

$qb

_qb_filter_results()

_qb_filter_results(  $results) 

Parameters

$results

_check_campaign_up_to_date()

_check_campaign_up_to_date() 

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