« All Handlers

onFormatMessageVars

The onFormatMessageVars handler is called on an array of $vars containing all of the variables about to be substituted into a notification message or email in the LiveWhale “messages” module. The example module below is abstracted from a need to overwrite certain variables in the RSVP “Registration Received” email.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$_LW->REGISTERED_APPS['my_app']=array(
'title'=>'My App',
'handlers'=>array('onFormatMessageVars'),
);

class LiveWhaleApplicationMyApp {

public function onFormatMessageVars($vars) { // override var for RSVP notifications when an appointment is applied
global $_LW;

// if this is a registration received message
if (!empty($vars['subject']) && strpos($vars['subject'], 'Registration Received')!==false) {

// do things..
// e.g., edit $vars['date_time'] or any other notification variable

}

return $vars;
}

}
?>