'Handle Mail Test', 'url' => 'http://habariproject.org', 'author' => 'Habari Community', 'authorurl' => 'http://habariproject.org', 'version' => 0.1, 'description' => 'Handles Utils::mail() and displays a message.', 'license' => 'Apache License 2.0', ); } public function filter_plugin_config( $actions, $plugin_id ) { if ( $plugin_id == $this->plugin_id() ) { $actions[] = _t( 'Test' ); } return $actions; } public function action_plugin_ui( $plugin_id, $action ) { if ( $plugin_id == $this->plugin_id() ) { if ( $action == _t( 'Test' ) ) { $result = Utils::mail( 'to@example.com', 'Test Email', 'This is a test email that should end up in the logs.' ); } } } public function filter_send_mail ( $handled, $mail ) { // stop all messages. log them and trigger a session alert instead $log = EventLog::log( "New mail message '" . $mail['subject'] . "' sent to " . $mail['to'] . ": " . $mail['message'] ); Session::notice( 'A new mail message, sent to ' . $mail['to'] . ', was handled. You can find it in the log with ID ' . $log->id ); return true; } } ?>