You are here

function redhen_contact_rules_action_info in RedHen CRM 7

Implements hook_rules_action_info().

File

modules/redhen_contact/includes/redhen_contact.rules.inc, line 11
Rules integration for RedHen Contacts.

Code

function redhen_contact_rules_action_info() {
  $actions = array();

  // Declare some defaults for all actions.
  $defaults = array(
    'group' => t('Redhen Contact'),
    'access callback' => 'redhen_contact_access',
  );

  // Add an action to load contact by email address.
  $actions['redhen_contact_fetch_by_mail'] = $defaults + array(
    'label' => t('Fetch contact by email'),
    'base' => 'redhen_contact_rules_action_fetch_by_mail',
    'provides' => array(
      'fetched_contact' => array(
        'type' => 'redhen_contact',
        'label' => t('Fetched contact'),
      ),
    ),
  );
  $actions['redhen_contact_fetch_by_mail']['parameter']['mail'] = array(
    'type' => 'text',
    'label' => t('Email address'),
    'description' => t('The email address to fetch by.'),
  );
  return $actions;
}