Skip to content

Commit 56690b8

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-92722: [Backport for 2.2.x] E-mail admin users when a new administrator is created.
1 parent 51c7033 commit 56690b8

File tree

2 files changed

+6
-709
lines changed

2 files changed

+6
-709
lines changed

app/code/Magento/User/Model/User.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,10 @@ class User extends AbstractModel implements StorageInterface, UserInterface
4242
*/
4343
const XML_PATH_FORGOT_EMAIL_TEMPLATE = 'admin/emails/forgot_email_template';
4444

45-
const XML_PATH_NEW_USER_EMAIL_TEMPLATE = 'admin/emails/new_user_notification_template';
46-
4745
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'admin/emails/forgot_email_identity';
4846

4947
const XML_PATH_USER_NOTIFICATION_TEMPLATE = 'admin/emails/user_notification_template';
5048

51-
const DEPLOYMENT_CONFIG_ADMIN_EMAIL = 'user_admin_email';
52-
5349
/** @deprecated */
5450
const XML_PATH_RESET_PASSWORD_TEMPLATE = 'admin/emails/reset_password_template';
5551

@@ -486,22 +482,21 @@ public function sendPasswordResetNotificationEmail()
486482
private function sendNewUserNotificationEmail()
487483
{
488484
$toEmails = [];
485+
489486
$generalEmail = $this->_config->getValue(
490487
'trans_email/ident_general/email'
491488
);
492489
if ($generalEmail) {
493490
$toEmails[] = $generalEmail;
494491
}
495-
$adminEmail = $this->deploymentConfig->get(
496-
static::DEPLOYMENT_CONFIG_ADMIN_EMAIL
497-
);
498-
if ($adminEmail) {
492+
493+
if ($adminEmail = $this->deploymentConfig->get('user_admin_email')) {
499494
$toEmails[] = $adminEmail;
500495
}
501496

502497
foreach ($toEmails as $toEmail) {
503498
$this->sendNotification(
504-
self::XML_PATH_NEW_USER_EMAIL_TEMPLATE,
499+
'admin/emails/new_user_notification_template',
505500
[
506501
'user' => $this,
507502
'store' => $this->_storeManager->getStore(

0 commit comments

Comments
 (0)