Jump to Content

Objective HTML

Postmaster

The definitive email solution for ExpressionEngine

Notifications API

Overview

The Base Notifications class is the class from which all other notifications are extended. To add your own notifications, create a class that extends the Base_notification class.

Notifications Directory
/system/expressionengine/third_party/postmaster/notifications
Class Suffix
_postmaster_notification

Example


class Your_notice_name_postmaster_notification extends Base_notification {
	
	protected $title = 'Your Notification Name';
	
	public function __construct($params = array())
	{
		parent::__construct($params);
	}
	
	public function send()
	{
		// Your send logic
		
		$vars = array(
			'var_1' => 'Some Value 1',
			'var_2' => 'Some Value 2',
			'var_3' => 'Some Value 3'
		);
		
		return parent::send($vars);
	}
}

This a simple example. None of these method are required and will still work if you don't replace them.

Properties

$title
The title of the hook.
$notification
The actual notification that is being used
$response
The service response from the email service after the notification has been sent.

Extends

Postmaster Base API