You are here

function notifications_messaging in Notifications 7

Same name and namespace in other branches
  1. 5 notifications.module \notifications_messaging()
  2. 6.4 notifications.module \notifications_messaging()
  3. 6 notifications.module \notifications_messaging()
  4. 6.2 notifications.module \notifications_messaging()
  5. 6.3 notifications.module \notifications_messaging()

Implementation of hook_messaging()

This hook provides information about the mensaje templates this module uses and related tokens.

Depending on $op, this hook takes different parameters and returns different pieces of information:

  • 'message groups' Get array of message groups, each of which will have one or more keys for different templates Each group should have a unique key, so it should start with the module name
  • 'message keys' Get message template parts for a given group ($arg1) Return array of key => name for each part
  • 'messages' Get default message templates for a given group ($arg1). It should return default texts, indexed by message key that will be the default templates These templates may be edited on the 'Messaging templates' page
  • 'tokens' Get available tokens for a given message group and key ($arg1). Return array of token keys that will be available for this message templates The tokens themselves may be default tokens (provided by token module) or we can add new tokens implementing hook_token_list() and hook_token_value()

Parameters

$op: Operation, type of information to retrieve

$arg1, $arg2...: Different parameters depending on $op

File

./notifications.module, line 1007
Notifications module

Code

function notifications_messaging($op, $arg1 = NULL, $arg2 = NULL) {
  switch ($op) {
    case 'message types':
      $info['notifications'] = array(
        'name' => t('Notifications'),
        'description' => t('Messages coming from user subscriptions and system events'),
      );
      return $info;
  }
}