You are here

function phpmailer_form_mimemail_admin_settings_alter in PHPMailer 7.3

Same name and namespace in other branches
  1. 8.3 phpmailer.module \phpmailer_form_mimemail_admin_settings_alter()
  2. 6.3 phpmailer.module \phpmailer_form_mimemail_admin_settings_alter()
  3. 6.2 phpmailer.module \phpmailer_form_mimemail_admin_settings_alter()
  4. 7.4 phpmailer.module \phpmailer_form_mimemail_admin_settings_alter()

Implements hook_form_FORM_ID_alter().

File

./phpmailer.module, line 46
Integrates the PHPMailer library for SMTP e-mail delivery.

Code

function phpmailer_form_mimemail_admin_settings_alter(&$form, &$form_state) {

  // Hide the Mime Mail global enabler setting if phpmailer is used to deliver
  // e-mails (they can't be both active).
  if (phpmailer_enabled()) {
    $mimemail_alter =& $form['mimemail']['mimemail_alter'];
    $mimemail_alter['#disabled'] = TRUE;
    $mimemail_alter['#default_value'] = 0;
    $mimemail_alter['#description'] = t('PHPMailer has been set to deliver all site messages. To let Mime Mail apply styles and formatting to system e-mails but still use PHPMailer for mail transport, uncheck <em>Use PHPMailer to send e-mails</em> first on the <a href="@url">PHPMailer settings page</a>. Then activate this setting and choose PHPMailer from the list of e-mail engines below.', array(
      '@url' => url('admin/config/system/phpmailer'),
    ));
  }

  // @todo Move to MimeMail project.
  $form['preview'] = array(
    '#type' => 'item',
    '#title' => t('Preview'),
    '#value' => t('See a <a href="@url" target="_blank">preview of a styled e-mail</a> using the current message template (<code>mimemail-message.tpl.php</code>).', array(
      '@url' => url('phpmailer/preview'),
    )),
  );
  $form['buttons']['#weight'] = 10;
}