From fe5e67265428dfe0cb2ff221cfe62da03df95038 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 14 Sep 2021 23:51:48 +0200 Subject: [PATCH] let user choose notification email in user settings Signed-off-by: Arthur Schiwon --- .../lib/Settings/Personal/PersonalInfo.php | 5 +- .../PersonalInfo/EmailSection/Email.vue | 65 +++++++++++++++++-- .../EmailSection/EmailSection.vue | 9 ++- .../src/constants/AccountPropertyConstants.js | 1 + .../src/service/PersonalInfo/EmailService.js | 20 ++++++ 5 files changed, 90 insertions(+), 10 deletions(-) diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 0a84f20f513..d03b01b3f46 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -231,7 +231,7 @@ class PersonalInfo implements ISettings { * @return array */ private function getEmails(IAccount $account): array { - $primaryEmail = [ + $systemEmail = [ 'value' => $account->getProperty(IAccountManager::PROPERTY_EMAIL)->getValue(), 'scope' => $account->getProperty(IAccountManager::PROPERTY_EMAIL)->getScope(), 'verified' => $account->getProperty(IAccountManager::PROPERTY_EMAIL)->getVerified(), @@ -249,8 +249,9 @@ class PersonalInfo implements ISettings { ); $emails = [ - 'primaryEmail' => $primaryEmail, + 'primaryEmail' => $systemEmail, 'additionalEmails' => $additionalEmails, + 'notificationEmail' => (string)$account->getUser()->getPrimaryEMailAddress(), ]; return $emails; diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue index 294283ffbaa..8095152fd43 100644 --- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue +++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue @@ -65,11 +65,19 @@ @click.stop.prevent="deleteEmail"> {{ deleteEmailLabel }} + + {{ setNotificationMailLabel }} + - + {{ t('settings', 'Primary email for password reset and notifications') }} @@ -78,14 +86,21 @@