You are here

function commerce_email_disable in Commerce Email 7.2

Implements hook_disable()

File

./commerce_email.install, line 35

Code

function commerce_email_disable() {

  // Activate default commerce rules to send order email
  $rules_config = rules_config_load('commerce_checkout_order_email');
  if ($rules_config->name) {
    $rules_config->active = TRUE;
    $rules_config
      ->save();
  }

  // Activate default commerce rules to create new account
  $rules_config = rules_config_load('commerce_checkout_new_account');
  if ($rules_config->name) {
    $rules_config->active = TRUE;
    $rules_config
      ->save();
  }

  // Remove the settings from MailSystem
  mailsystem_clear(array(
    'variable_email' => '',
  ));
}