You are here

function htmlmail_requirements in HTML Mail 7.2

Same name and namespace in other branches
  1. 6.2 htmlmail.install \htmlmail_requirements()

Implements hook_requirements().

Ensures that the Mail System module is available, and that HTML Mail uses its own MailSystemInterface class.

1 call to htmlmail_requirements()
htmlmail_update_7203 in ./htmlmail.install
Implements hook_update_N().

File

./htmlmail.install, line 14
Installation for HTML Mail module.

Code

function htmlmail_requirements($phase) {
  $t = get_t();
  $result = array();
  if ($phase === 'install') {
    return $result;
  }
  if (module_load_include('inc', 'mailsystem', 'html_to_text') !== FALSE) {
    return $result;
  }
  $args = array(
    '%htmlmail' => 'HTML Mail',
    '!htmlmail' => 'https://www.drupal.org/project/htmlmail',
    '%mailsystem' => 'Mail System',
    '!mailsystem' => 'https://www.drupal.org/project/mailsystem',
  );
  $result['htmlmail_mailsystem'] = array(
    'title' => $t('%mailsystem module', $args),
    'value' => $t('7.x-1.x'),
    'description' => $t('<a href="!htmlmail">%htmlmail</a> new requires <a href="!mailsystem">%mailsystem</a> 7.x-2.6 or later.  Please download and install a recent version of <a href+"!mailsystem">%mailsystem</a>, then re-enable the <a href="!htmlmail">%htmlmail</a> module.', $args),
    'severity' => REQUIREMENT_ERROR,
  );
  return $result;
}