function hook_commerce_gc_product_new_recipient_user_alter in Commerce GC 7
If the purchasing customer has specified a new email address for the giftcard recipient, this hook allows modules to alter the newly created user.
Parameters
stdClass $user: A newly created user that is about to be saved
CommerceCoupon $coupon: The coupon that was created for the new user
1 invocation of hook_commerce_gc_product_new_recipient_user_alter()
- commerce_gc_product_attach_giftcard_to_user_recipient in modules/
commerce_gc_product/ commerce_gc_product.rules.inc
File
- modules/
commerce_gc_product/ commerce_gc_product.api.php, line 28
Code
function hook_commerce_gc_product_new_recipient_user_alter($user, $coupon) {
// Add a default role
$user->roles[] = 'Recipient role';
}