You are here

function reroute_email_requirements in Reroute Email 7

Same name and namespace in other branches
  1. 8 reroute_email.install \reroute_email_requirements()
  2. 2.x reroute_email.install \reroute_email_requirements()

Implements hook_requirements().

File

./reroute_email.install, line 11
Reroute Email module installation functions.

Code

function reroute_email_requirements($phase) {
  $requirements = array();
  if ($phase === 'runtime' && variable_get(REROUTE_EMAIL_ENABLE, 0)) {
    $settings = array(
      '@path' => url('admin/config/development/reroute_email'),
      '%addresses' => variable_get(REROUTE_EMAIL_ADDRESS, ''),
    );
    if (empty($settings['%addresses'])) {
      $message = t('All outgoing emails (<a href="@path">configure whitelist</a>) would be aborted and recorded in the recent log entries (if enabled).', $settings);
    }
    else {
      $message = t('All outgoing emails (<a href="@path">configure whitelist</a>) would be rerouted to: %addresses', $settings);
    }
    $requirements['reroute_email'] = array(
      'title' => t('Reroute Email'),
      'value' => $message,
      'severity' => REQUIREMENT_WARNING,
    );
  }
  return $requirements;
}