You are here

function uc_coupon_purchase_rules_action_info in Ubercart Discount Coupons 7.2

Same name and namespace in other branches
  1. 7.3 uc_coupon_purchase/uc_coupon_purchase.rules.inc \uc_coupon_purchase_rules_action_info()

Implements hook_rules_action_info().

File

uc_coupon_purchase/uc_coupon_purchase.rules.inc, line 33
Rules integration for uc_coupon_purchase

Code

function uc_coupon_purchase_rules_action_info() {
  $actions = array();
  $actions['uc_coupon_purchase_email'] = array(
    'label' => t('Send an order email regarding coupon purchase.'),
    'group' => t('Coupon'),
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
        'optional' => TRUE,
      ),
      'coupon' => array(
        'type' => 'uc_coupon',
        'label' => t('Coupon'),
      ),
      'from' => array(
        'type' => 'text',
        'label' => t('Sender'),
      ),
      'addresses' => array(
        'type' => 'text',
        'label' => t('Recipients'),
        'description' => t('Enter the email addresses to receive the notifications, one on each line. You may use order tokens for dynamic email addresses.'),
      ),
      '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_coupon_purchase_message_formats',
      ),
    ),
  );
  $actions['uc_coupon_purchase_create_action'] = array(
    'label' => t('Clone coupon and assign to a user'),
    'group' => t('Coupon'),
    'provides' => array(
      'coupon' => array(
        'type' => 'uc_coupon',
        'label' => t('Coupon'),
      ),
    ),
    'parameter' => array(
      'cid' => array(
        'type' => 'integer',
        'label' => t('Coupon'),
        'description' => t('Select the base coupon to be assigned.'),
        'options list' => 'uc_coupon_purchase_cid_options',
        'restriction' => 'input',
      ),
      'user' => array(
        'type' => 'user',
        'label' => t('User to who we assing coupon'),
      ),
      'quantity' => array(
        'type' => 'integer',
        'label' => t('Quantity (multiplied by bulk coupon)'),
      ),
    ),
  );
  return $actions;
}