You are here

function htmlmail_user_presave in HTML Mail 7.2

Same name and namespace in other branches
  1. 8.2 htmlmail.module \htmlmail_user_presave()
  2. 7 htmlmail.module \htmlmail_user_presave()

Implements hook_user_presave().

File

./htmlmail.module, line 181
Sends system emails in HTML.

Code

function htmlmail_user_presave(&$edit, $account, $category) {
  if (isset($account->uid) && $account->uid > 0) {
    if (user_access('choose htmlmail_plaintext') || user_access('administer users')) {
      $edit['data']['htmlmail_plaintext'] = empty($edit['htmlmail_plaintext']) ? 0 : 1;
      unset($edit['htmlmail_plaintext']);
    }
  }
}