You are here

function notifications_digest_messaging_template in Notifications 6.3

Implementation of hook_messaging_template()

File

notifications_digest/notifications_digest.module, line 41
Notifications message digest

Code

function notifications_digest_messaging_template($op, $type = NULL, $langcode = NULL) {
  switch ($op) {
    case 'templates':
      $info['notifications-digest'] = array(
        'module' => 'notifications',
        'type' => 'notifications',
        'title' => t('Notifications digest', array(), $langcode),
        'description' => t('Depending on your settings for each Send interval, Notifications may be digested, this is grouped and summarized in a single message. These are the common parts for Notifications digests.', array(), $langcode),
      );
      return $info;
    case 'keys':
      if ($type == 'notifications-digest') {
        return array(
          'subject' => t('Subject', array(), $langcode),
          'header' => t('Header', array(), $langcode),
          'main' => t('Line for digested events'),
          'closing' => t('Group closing', array(), $langcode),
          'footer' => t('Footer', array(), $langcode),
        );
      }
      elseif (strpos($type, 'notifications-event') === 0 || strpos($type, 'notifications-content') === 0) {
        return array(
          'digest' => t('Digest line', array(), $langcode),
        );
      }
      elseif (strpos($type, 'notifications-digest') === 0) {
        return array(
          'title' => t('Group title', array(), $langcode),
          'closing' => t('Group footer', array(), $langcode),
        );
      }
      break;
    case 'defaults':

      // Digested messages
      if ($type == 'notifications-digest') {
        return array(
          'subject' => t('[site-name] subscription update for [user]', array(), $langcode),
          'header' => t("Greetings, [user].\n\nThese are your messages", array(), $langcode),
          'main' => t("A [type] has been updated: [title]\n\n[event_list]", array(), $langcode),
          'closing' => '...',
          'footer' => array(
            t('This is an automatic message from [site-name]', array(), $langcode),
            t('To manage your subscriptions, browse to [subscriptions-manage]', array(), $langcode),
          ),
        );
      }
      break;
  }
}