Jump to Content

Objective HTML


The definitive email solution for ExpressionEngine

Utilities API


Utilities allow developers to add additional template tags without hacking the core. The create a new Postmaster utility, you need to create a Delegate - which is a new type of API for ExpressionEngine. Delegates allow add-on developer an extendible base to build EE tags. Once a module has been built on top of a delagate architecture, other developers can add new tag without hacking the core.

So why it is a utility, but yet it is called a delegate?

To the end user, the concept of a delegate is pretty hard to grasp. The term Utility is really just a more friendly way of sayings Delegate. However, the Delegate API is not exlusive to Postmaster, therefore this specific implementation has been named Utilities.

Delegate Tag Breakdown

// Delegate Syntax

// An actual Delegate

// Prior to EE 2.5 the delegate method in the 3rd segment

A delegate tag functions just like EE. It has four segments, but works the same as a tag with 2 or 3. However, delegates require EE 2.5+ so a 5 segment tag is required to make it work for older version.

Delegates Directory
Class Suffix

Delegate Class

class Your_delegate_name_postmaster_delegate extends Base_delegate {
	public function __construct()
	public function your_method_name()
		$params = array(
			'abc' => $this->param('abc')
		// Do something

Delegate Tag

	{exp:postmaster:your_delagate_name:your_method_name abc="123"}


The global EE instance object
The delegate class suffix
The delegate name


These methods are available in the delegate class since you inherited the Base_delegate.


Get a delegate object by passing the delegate name as a string.

Delegate name as a string

(object) A delegate object.

get_delegates($name = FALSE, $directory = '../delegates')

Get all the delegates in any given directory.

Delegate name as a string
Directory path of the delegates/dd>

(array) An array of delegate objects.


Output a JSON response

Mixed datatype to be encoded to a JSON string

(JSON) JSON Object


Load a delegate object

Delegate name as a string

(JSON) JSON Object

param($param, $default = FALSE, $boolean = FALSE, $required = FALSE)

Fetch a template tag parameter

Parameter name as a string
The default parameter value, which is FALSE by default.
Is the parameter a boolean value
Is the parameter required

(string) Parameter value

parse($vars, $tagdata = FALSE)

Parse an array of variable and return a string

An array of variables to be parsed
This is the string to parse, if FALSE the template tagdata is used.

(string) A parsed string


Output an error string

An error string to output

tag_part($param, $default = FALSE, $boolean = FALSE)

Fetch a template tag parameter

Tagparam name as a string
The default tagpart value, which is FALSE by default.
Is the tagpart a boolean value

(string) Parameter value