You are here

function notifications_scheduler_action_info in Notifications 7

Implementation of hook_action_info()

Automatically creates actions for scheduled notifications.

File

notifications_scheduler/notifications_scheduler.module, line 89
Notifications scheduler module

Code

function notifications_scheduler_action_info() {
  $actions = array();
  foreach (notifications_info('event types') as $key => $info) {
    if (isset($info['triggers']['job_scheduler']) && !empty($info['actions'])) {

      // Does it make sense for these events to have more than one action?
      foreach ($info['actions'] as $action_name) {
        $actions[$action_name] = array(
          'type' => 'notifications',
          'label' => t('Scheduled notification: @name', array(
            '@name' => $info['title'],
          )),
          'configurable' => !empty($info['configurable']),
          'behavior' => array(
            'sends_notification',
          ),
          'triggers' => array(
            'any',
          ),
        );
      }
    }
  }
  return $actions;
}