You are here

function mimemail_form_user_profile_form_alter in Mime Mail 7

Implements hook_form_FORM_ID_alter().

Adds the Mime Mail settings on the user settings page.

File

./mimemail.module, line 130
Component module for sending Mime-encoded emails.

Code

function mimemail_form_user_profile_form_alter(&$form, &$form_state) {
  if ($form['#user_category'] == 'account') {
    $account = $form['#user'];
    $form['mimemail'] = array(
      '#type' => 'fieldset',
      '#title' => t('Email settings'),
      '#weight' => 5,
      '#collapsible' => TRUE,
      '#access' => user_access('edit mimemail user settings'),
    );
    $form['mimemail']['mimemail_textonly'] = array(
      '#type' => 'checkbox',
      '#title' => t('Plaintext email only'),
      '#default_value' => !empty($account->data['mimemail_textonly']) ? $account->data['mimemail_textonly'] : FALSE,
      '#description' => t('Check this option if you do not wish to receive email messages with graphics and styles.'),
    );
  }
}