\org_openpsa_directmarketing_sender_backend_email

Campaign message sender backend for email

Summary

Methods
Properties
Constants
__construct()
add_member_constraints()
check_results()
get_type()
send()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_get_attachments()
_insert_link_detector()
$_config
$_message
N/A

Properties

$_config

$_config : 

Type

Methods

__construct()

__construct(array  $config, \org_openpsa_directmarketing_campaign_message_dba  $message) 

Constructor

Parameters

array $config

Backend configuration

\org_openpsa_directmarketing_campaign_message_dba $message

The message we're working on

add_member_constraints()

add_member_constraints(\midcom_core_querybuilder  $qb) 

Adds necessary constraints to member QB to find valid entries

Parameters

\midcom_core_querybuilder $qb

The QB instance to work on

check_results()

check_results(array  $results) : boolean

Validate results before send

Parameters

array $results

Array of member objects

Returns

boolean —

Indicating success

get_type()

get_type() : string

Backend type, for example 'email' or 'sms'

Returns

string

send()

send(\org_openpsa_contacts_person_dba  $person, \org_openpsa_directmarketing_campaign_member_dba  $member, string  $token, string  $subject, string  $content, string  $from) 

This does the actual sending

Parameters

\org_openpsa_contacts_person_dba $person

The recipient

\org_openpsa_directmarketing_campaign_member_dba $member

The member object

string $token

Message token

string $subject

Message subject

string $content

Message content

string $from

Message sender

_get_attachments()

_get_attachments() : array

Go trough DM2 types array for attachments

Returns

array

_insert_link_detector()

_insert_link_detector(string  $html, string  $address) : string

Inserts a link detector to the given HTML source. All outgoing HTTP links in the source HTML are replaced with the given link detector address so that the token "URL" is replaced with encoded form of the original link. It is expected that the link detector address points to a script that records the passed link and forwards the client to the real link target.

Parameters

string $html

the HTML source

string $address

the link detector address

Returns

string —

HTML source with the link detector