diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index acb9813..cb71a61 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -393,8 +393,8 @@ function user_admin_settings($form, &$form_state) { $form['mail_notification_address'] = array( '#type' => 'email', '#title' => t('E-mail address'), - '#default_value' => config('system.site')->get('notification'), - '#description' => "The e-mail address to be used as the 'from' address for all notifications. If 'Visitors, but administrator approval is required' is selected above, a notification email will also be sent to this address for any new registrations. Leave empty to use the default system e-mail address (" . config('system.site')->get('mail') . ").", + '#default_value' => config('system.site')->get('mail_notification'), + '#description' => t("The e-mail address to be used as the 'from' address for all notifications. If 'Visitors, but administrator approval is required' is selected above, a notification email will also be sent to this address for any new registrations. Leave empty to use the default system e-mail address (%site-email).", array('%site-email' => config('system.site')->get('mail'))), '#maxlength' => 180, ); @@ -657,7 +657,7 @@ function user_admin_settings_submit($form, &$form_state) { ->set('status_canceled.subject', $form_state['values']['user_mail_status_canceled_subject']) ->save(); config('system.site') - ->set('notification', $form_state['values']['mail_notification_address']) + ->set('mail_notification', $form_state['values']['mail_notification_address']) ->save(); } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 2621d00..fc0d640 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -2487,18 +2487,21 @@ function _user_mail_notify($op, $account, $langcode = NULL) { if ($notify || ($op != 'status_canceled' && $op != 'status_blocked')) { $params['account'] = $account; $langcode = $langcode ? $langcode : user_preferred_langcode($account); - // Get the custom site notification email to use as the from email address if it has been set. - $site_mail = config('system.site')->get('notification'); + // Get the custom site notification email to use as the from email address + // if it has been set. + $site_mail = config('system.site')->get('mail_notification'); + // If the custom site notification email has not been set, we use the site + // default for this. + if (empty($site_mail)) { + $site_mail = config('system.site')->get('mail'); + } + if (empty($site_mail)) { + $site_mail = ini_get('sendmail_from'); + } $mail = drupal_mail('user', $op, $account->mail, $langcode, $params, $site_mail); if ($op == 'register_pending_approval') { // If a user registered requiring admin approval, notify the admin, too. - // If the custom site notification email has not been set, we use the site default language for this. - if (empty($site_mail)) { - $site_mail = config('system.site')->get('mail'); - } - if (empty($site_mail)) { - $site_mail = ini_get('sendmail_from'); - } + // We use the site default language for this. drupal_mail('user', 'register_pending_approval_admin', $site_mail, language_default()->langcode, $params); } }