You are here

function hook_commerce_registration_defer in Commerce Registration 7.2

Allow modules to react to a registration being deferred.

This could be used, for example, to send the participant an email notifying them of the deferral.

Parameters

array $context: array( 'original' => array( 'registration' => $original_registration, 'line item' => $original_line_item, ), 'new' => array( 'registration' => $new_registration, 'line item' => $line_item, ), 'order' => $order, );

1 invocation of hook_commerce_registration_defer()
commerce_registration_defer_form_submit in modules/commerce_registration_defer/commerce_registration_defer.module
Submit callback for the registration deferral form.

File

modules/commerce_registration_defer/commerce_registration_defer.api.php, line 26
API documentation for commerce_registration_defer module.

Code

function hook_commerce_registration_defer($context) {
  $message = 'Looks like you are all set up to take another course instead of this one. Which one you say... that one.';

  // Send the email.
  $params = array(
    'subject' => t('Your registration has been deferred'),
    'body' => check_markup(t($message), 'plain_text'),
  );
  drupal_mail('example', 'deferral', $context['original']['registration']->anon_mail, language_default(), $params);
}