function message_notify_send_message in Message Notify 7.2
Process and send a message.
Parameters
$message: The message entity being used for the notification.
$options: Array of options to override the plugin's default ones.
$notifier_name: Optional; The name of the notifier to use. Defaults to "email" sending method.
Return value
Boolean value denoting success or failure of the notification.
6 calls to message_notify_send_message()
- MessageNotifyNotifierTest::testDeliver in ./
message_notify.test - Test send method.
- MessageNotifyNotifierTest::testPostSendMessageSave in ./
message_notify.test - Test Message save on delivery.
- MessageNotifyNotifierTest::testPostSendRenderedField in ./
message_notify.test - Test populating the rednered output to fields.
- message_notify_example_comment_insert in message_notify_example/
message_notify_example.module - Implements hook_comment_insert().
- message_notify_rules_process in ./
message_notify.rules.inc - Action: Process and send Message.
File
- ./
message_notify.module, line 22 - Message notify.
Code
function message_notify_send_message(Message $message, array $options = array(), $notifier_name = 'email') {
if (!($plugin = message_notify_get_notifier($notifier_name))) {
throw new MessageNotifyException(format_string('Could not send notification using the "@notifier" notifier.', array(
'@notifier' => $notifier_name,
)));
}
$plugin['options'] = drupal_array_merge_deep($plugin['options'], $options);
$class = ctools_plugin_load_class('message_notify', 'notifier', $notifier_name, 'class');
$notifier = new $class($plugin, $message);
if ($notifier
->access()) {
return $notifier
->send();
}
}