You are here

function uc_roles_rules_action_info in Ubercart 7.3

Implements hook_rules_action_info().

File

uc_roles/uc_roles.rules.inc, line 84
Rules hooks for uc_roles.module.

Code

function uc_roles_rules_action_info() {

  // Renew a role expiration.
  $actions['uc_roles_order_renew'] = array(
    'label' => t('Renew the roles on an order.'),
    'group' => t('Renewal'),
    'base' => 'uc_roles_action_order_renew',
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
      'message' => array(
        'type' => 'boolean',
        'label' => t('Display messages to alert users of any new or updated roles.'),
      ),
    ),
  );
  $email_args = array(
    'expiration' => array(
      'type' => 'uc_roles_expiration',
      'label' => t('Role expiration'),
    ),
    'from' => array(
      'type' => 'text',
      'label' => t('Sender'),
    ),
    'addresses' => array(
      'type' => 'text',
      'label' => t('Recipients'),
    ),
    'subject' => array(
      'type' => 'text',
      'label' => t('Subject'),
    ),
    'message' => array(
      'type' => 'text',
      'label' => t('Message'),
    ),
    'format' => array(
      'type' => 'text',
      'label' => t('Message format'),
      'options list' => 'uc_roles_message_formats',
    ),
  );

  // Send an email to an order with a role expiration.
  $actions['uc_roles_order_email'] = array(
    'label' => t('Send an order email regarding roles.'),
    'group' => t('Notification'),
    'base' => 'uc_roles_action_order_email',
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
    ) + $email_args,
  );

  // Send an email to a user with a role expiration.
  $actions['uc_roles_user_email'] = array(
    'label' => t('Send a user an email regarding roles.'),
    'group' => t('Notification'),
    'base' => 'uc_roles_action_user_email',
    'parameter' => array(
      'account' => array(
        'type' => 'user',
        'label' => t('User'),
      ),
    ) + $email_args,
  );
  return $actions;
}