Jump to Content

Objective HTML

Postmaster

The definitive email solution for ExpressionEngine

Postmaster Base API

The Postmaster Base API class is an abstract class from which all other classes are extended.

Properties

$service
The service being used to send the email.
$parse_fields
This is a static property that passes indexes with the names of the variables that should be parsed.

Extends

Postmaster Core

Methods

build_table($settings, $fields = FALSE)

The build_table method accepts an array of settings used to build a settings form. The parcel and hook obj contains the settings value. The build_table() method is a convenience method for using Interface Builder.

$settings
The settings variable contains a settings array for Interface Builder.
$fields
If not false, this is an associative array of settings for InterfaceBuilder.
Return

(string) HTML Table of Settings

default_settings()

This method returns an object of the default settings.

Return

(object) Any object

display_settings($settings)

The display_settings method accepts an array of settings used to build a settings form. The parcel and hook obj contains the settings value.

$settings
The settings variable contains a settings array for Interface Builder.
Return

(string) HTML Table of Settings

get_settings($settings = FALSE)

The get_settings method accepts an array of settings which is used to return only the settings assigned to the email service.

$settings
If not FALSE, this is an associative array of settings to override the current settings property.
Return

(array) an empty or associative array of settings.

parse($hook, $vars = array(), $member = FALSE, $entry = array())

Parse a hook with additional variables.

$hook
A valid hook name
$vars
An associative array of additional variables to parse along with the hook (besides entry data). These vars will get prefixed with "hook:".
$member_data
If FALSE, the logged in member is used. Otherwise, pass an associative array of data that will get prefix "member:".
$entry_data
An associative array of entry data. The indexed should be the varialble, and the value will be passed and parsed against the respected FT.
Return

(object) An object of parsed data

pre_pocess($vars = array())

This method allows devs to execute arbitrary logic before the hook's email is sent.

$vars
An associative array of arguments that will be passed to the trigger() method.
Return

NULL

post_pocess($vars = array())

This method allows devs to execute arbitrary logic after the hook's email is sent.

$vars
An associative array of arguments that were passed to the trigger() method.
Return

NULL

send($vars = array(), $member_data = FALSE, $entry_data = array(), $return_data = 'Undefined')

Send the hook's email

$vars
An associative array of additional variables to parse along with the hook (besides entry data). These vars will get prefixed with "hook:".
$member_data
If FALSE, the logged in member is used. Otherwise, pass an associative array of data that will get prefix "member:".
$entry_data
An associative array of entry data. The indexed should be the varialble, and the value will be passed and parsed against the respected FT.
$return_data
A mixed variable. If 'Undefined', no value is return, otherwise the passed value is returned.
Return

(object) An object


$return = (object) array(
	'end_script'  => $end_script,
	'response'    => (Postmaster_Service_Response) $response,
	'return_data' => $return_data 
);

trigger(mixed $var [, mixed $... ])

This is the method that will be triggered from the ExpressionEngine hook. Any argument that is passed by the hook you are using will be available in this method too.

$vars
An associative array of arguments that were passed to the trigger() method.
Return

(object) An object

$return = $this->send();