function commerce_gc_product_rules_action_info in Commerce GC 7
File
- modules/
commerce_gc_product/ commerce_gc_product.rules.inc, line 11 - Provides Rules module support for buying giftcards.
Code
function commerce_gc_product_rules_action_info() {
$actions['commerce_gc_product_line_item_generate_giftcard'] = array(
'label' => t('Generate giftcard coupons for a giftcard line item'),
'group' => t('Commerce Giftcard'),
'parameter' => array(
'commerce_line_item' => array(
'type' => 'commerce_line_item',
'label' => t('Line item'),
'wrapped' => TRUE,
),
),
'provides' => array(
'giftcard_coupon' => array(
'type' => 'commerce_coupon',
'label' => t('Giftcard coupon'),
),
),
);
$actions['commerce_gc_product_giftcard_email_variables'] = array(
'label' => t('Provide variables for a giftcard notification email.'),
'group' => t('Commerce Giftcard'),
'parameter' => array(
'commerce_line_item' => array(
'type' => 'commerce_line_item',
'label' => t('Line item'),
'wrapped' => TRUE,
),
),
'provides' => array(
'giftcard_mail' => array(
'type' => 'token',
'label' => t('Giftcard mail'),
),
),
);
$actions['commerce_gc_product_attach_giftcard_to_user_recipient'] = array(
'label' => t('Attach a giftcard to a user'),
'group' => t('Commerce Giftcard'),
'parameter' => array(
'mail' => array(
'type' => 'text',
'label' => t('User mail'),
),
'commerce_coupon' => array(
'type' => 'commerce_coupon',
'label' => t('Giftcard coupon'),
'wrapped' => TRUE,
),
'email_type' => array(
'type' => 'text',
'label' => t('E-mail type'),
'description' => t("Select the e-mail based on your site's account settings to send to the user."),
'options list' => 'commerce_gc_product_account_email_options_list',
),
),
'provides' => array(
'user_recipient' => array(
'type' => 'user',
'label' => t('User recipient'),
),
),
);
return $actions;
}