You are here

messaging_phpmailer.install in Messaging 5

File

messaging_phpmailer/messaging_phpmailer.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function messaging_phpmailer_install() {
  drupal_set_message('Messaging PHPMailer sucessfully installed!');
}

/**
 * Implementation of hook_requirements().
 */
function messaging_phpmailer_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();
  if ($phase == 'runtime') {
    $path = drupal_get_path('module', 'messaging_phpmailer') . '/PHPMailer';
    if (!file_exists($path . '/class.phpmailer.php')) {
      $requirements['messaging_hmtl_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 and place the phpmailer folder in your messaging_phpmailer module directory. Rename the folder to "PHPMailer".'),
      );
    }
  }
  return $requirements;
}

Functions