Dispatcher object.

Used to create a closure for a notification dispatch, so we can then tell that to send in the background (register_shutdown_function), for performance reasons.

package core_notifications

 Methods

Construct notification dispatcher.

__construct(\ID_TEXT $notification_code, \?SHORT_TEXT $code_category, \SHORT_TEXT $subject, \LONG_TEXT $message, \?array $to_member_ids, \?integer $from_member_id, integer $priority, boolean $store_in_staff_messaging_system, boolean $no_cc, \?ID_TEXT $no_notify_for__notification_code, \?SHORT_TEXT $no_notify_for__code_category, string $subject_prefix = '', string $subject_suffix = '', string $body_prefix = '', string $body_suffix = '', \?array $attachments = null, boolean $use_real_from = false
range 1 5

Parameters

$notification_code

\ID_TEXT

The notification code to use

$code_category

\?SHORT_TEXT

The category within the notification code (null: none). If it is to have $store_in_staff_messagingsystem, it must have the format

$subject

\SHORT_TEXT

Message subject (in Comcode)

$message

\LONG_TEXT

Message body (in Comcode)

$to_member_ids

\?array

List of enabled members to limit sending to (null: everyone)

$from_member_id

\?integer

The member ID doing the sending. Either a MEMBER or a negative number (e.g. A_FROM_SYSTEM_UNPRIVILEGED) (null: current member)

$priority

integer

The message priority (1=urgent, 3=normal, 5=low)

$store_in_staff_messaging_system

boolean

Whether to create a topic for discussion (ignored if the staff_messaging addon not installed)

$no_cc

boolean

Whether to NOT CC to the CC address

$no_notify_for__notification_code

\?ID_TEXT

DO NOT send notifications to: The notification code (null: no restriction)

$no_notify_for__code_category

\?SHORT_TEXT

DO NOT send notifications to: The category within the notification code (null: none / no restriction)

$subject_prefix

string

Only relevant if $store_in_staff_messaging_system is true: subject prefix for storage

$subject_suffix

string

Only relevant if $store_in_staff_messaging_system is true: subject suffix for storage

$body_prefix

string

Only relevant if $store_in_staff_messaging_system is true: body prefix for storage

$body_suffix

string

Only relevant if $store_in_staff_messaging_system is true: body suffix for storage

$attachments

\?array

A list of attachments (each attachment being a map, path=>filename) (null: none)

$use_real_from

boolean

Whether we will make a "reply to" direct -- we only do this if we're allowed to disclose email addresses for this particular notification type (i.e. if it's a direct contact)

Send out a notification to members enabled.

dispatch() 

 Properties

 

$attachments

$attachments 

Default

null
 

$body_prefix

$body_prefix 

Default

''
 

$body_suffix

$body_suffix 

Default

''
 

$code_category

$code_category 

Default

null
 

$from_member_id

$from_member_id 

Default

null
 

$message

$message 

Default

null
 

$no_cc

$no_cc 

Default

null
 

$no_notify_for__code_category

$no_notify_for__code_category 

Default

null
 

$no_notify_for__notification_code

$no_notify_for__notification_code 

Default

null
 

$notification_code

$notification_code 

Default

null
 

$priority

$priority 

Default

null
 

$store_in_staff_messaging_system

$store_in_staff_messaging_system 

Default

null
 

$subject

$subject 

Default

null
 

$subject_prefix

$subject_prefix 

Default

''
 

$subject_suffix

$subject_suffix 

Default

''
 

$to_member_ids

$to_member_ids 

Default

null
 

$use_real_from

$use_real_from 

Default

false