\apex\coreNotification

Handles creating and managing the e-mail notifications within the system, including obtaining the lists of senders / recipients / available merge fields, and so on.

Summary

Methods
Properties
Constants
get_merge_fields()
get_merge_vars()
get_recipient()
send()
create()
edit()
delete()
create_options()
add_mass_queue()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$emailer
N/A

Properties

Methods

get_merge_fields()

get_merge_fields(string  $controller): array

Get available merge fields from a certain notification controller.

Parameters

string $controller

The notification controller to obtain merge fields of.

Returns

array —

All availalbe merge fields.

get_merge_vars()

get_merge_vars(string  $controller,integer  $userid,array  $data = array()): array

Get mrege variables for an e-mail notification

Parameters

string $controller

The e-mail notification controller

integer $userid

The ID# of the user, if appropriate

array $data

Any additional data passed when processing the e-mail notifications

Returns

array —

Returns a key-value pair of all merge variables

get_recipient()

get_recipient(string  $recipient,integer  $userid)

Get a sender / recipient name and e-mail address.

Parameters

string $recipient

The sender string (eg. admin:1, user, etc.)

integer $userid

The ID# of the user.

send()

send(integer  $userid,integer  $notification_id,array  $data)

Send a single notification

Parameters

integer $userid

The ID# of the user the e-mail is being sent against

integer $notification_id

The ID# of the notification to send

array $data

The $data array passed to the message::process_emails() function

create()

create(array  $data = array())

is executed when creating a notification within the admin panel.

Parameters

array $data

The POSTed variables or other variables to create notification with.

edit()

edit(integer  $notification_id)

Edit notification

Parameters

integer $notification_id

The ID# of the notification to edit

delete()

delete(integer  $notification_id)

Delete notification

Parameters

integer $notification_id

The ID# of the notification to delete.

create_options()

create_options(string  $selected = ''): string

Create select list options of all e-mail notifications in the database.

Parameters

string $selected

The selected notification

Returns

string —

The HTML code of all options

add_mass_queue()

add_mass_queue(string  $type,string  $controller,string  $message,string  $subject = '',string  $from_name = '',string  $from_email = '',string  $reply_to = '',array  $condition = array())

Add a mass e-mailing to the queue

Parameters

string $type

The type of notification. Must be either 'email' or 'sms'

string $controller

The controller to user to gather the recipients. Defaults to 'users'

string $message

The contents of the message to send

string $subject

The subject of the e-mail message

string $from_name

The sender name of the e-mail message

string $from_email

The sender e-mail address of the e-mail message

string $reply_to

The reply-to e-mail address of the e-mail message

array $condition

An array containing the filter criteria defining which users to broadcast to.