_user_mail_notify

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 _user_mail_notify($op, $account, $language = NULL)

Conditionally create and send a notification email when a certain operation happens on the given user account.

Übergabeparameter

$op The operation being performed on the account. Possible values: 'register_admin_created': Welcome message for user created by the admin 'register_no_approval_required': Welcome message when user self-registers 'register_pending_approval': Welcome message, user pending admin approval 'password_reset': Password recovery request 'status_activated': Account activated 'status_blocked': Account blocked 'status_deleted': Account deleted

$account The user object of the account being notified. Must contain at least the fields 'uid', 'name', and 'mail'.

$language Optional language to use for the notification, overriding account language.

Rückgabewert

The return value from drupal_mail_send(), if ends up being called.

See also

user_mail_tokens()

drupal_mail()

▾ 4 functions call _user_mail_notify()

user_delete in modules/user/user.module
Delete a user.
user_pass_submit in modules/user/user.pages.inc
user_register_submit in modules/user/user.module
Submit handler for the user registration form.
user_save in modules/user/user.module
Save changes to a user account or add a new user.

Code

modules/user/user.module, line 2193

<?php
function _user_mail_notify($op, $account, $language = NULL) {
  // By default, we always notify except for deleted and blocked.
  $default_notify = ($op != 'status_deleted' && $op != 'status_blocked');
  $notify = variable_get('user_mail_' . $op . '_notify', $default_notify);
  if ($notify) {
    $params['account'] = $account;
    $language = $language ? $language : user_preferred_language($account);
    $mail = drupal_mail('user', $op, $account->mail, $language, $params);
    if ($op == 'register_pending_approval') {
      // If a user registered requiring admin approval, notify the admin, too.
      // We use the site default language for this.
      drupal_mail('user', 'register_pending_approval_admin', variable_get('site_mail', ini_get('sendmail_from')), language_default(), $params);
    }
  }
  return empty($mail) ? NULL : $mail['result'];
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen