You are here

function messaging_phpmailer_requirements in Messaging 6.4

Same name and namespace in other branches
  1. 5 messaging_phpmailer/messaging_phpmailer.install \messaging_phpmailer_requirements()
  2. 6 messaging_phpmailer/messaging_phpmailer.install \messaging_phpmailer_requirements()
  3. 6.2 messaging_phpmailer/messaging_phpmailer.install \messaging_phpmailer_requirements()
  4. 6.3 messaging_phpmailer/messaging_phpmailer.install \messaging_phpmailer_requirements()

Implementation of hook_requirements().

File

messaging_phpmailer/messaging_phpmailer.install, line 19

Code

function messaging_phpmailer_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();
  if ($phase == 'runtime') {
    drupal_load('module', 'messaging_phpmailer');
    if (!messaging_phpmailer_load_library()) {
      $requirements['messaging_html_mail'] = array(
        'title' => $t('Messaging PHPMailer'),
        'value' => $t('PHP Mailer missing'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('HTML Mail requires the <a href="http://phpmailer.codeworxtech.com/">PHP Mailer</a> class to properly send HTML Mail. Please download the 2.0 version (if using PHP4) or the 5.0 version (if using PHP5) and place the phpmailer folder in your messaging_phpmailer module directory. Rename the folder to "PHPMailer".'),
      );
    }
  }
  return $requirements;
}