aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/service
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-09-14 23:51:48 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2021-09-15 15:38:40 +0200
commitfe5e67265428dfe0cb2ff221cfe62da03df95038 (patch)
tree4c7dff7e5b8e4b088f12b5305c8a32c5ade10bf2 /apps/settings/src/service
parent995aa6518357b9f371ced5ba8941dfd2a02b0d97 (diff)
downloadnextcloud-server-fe5e67265428dfe0cb2ff221cfe62da03df95038.tar.gz
nextcloud-server-fe5e67265428dfe0cb2ff221cfe62da03df95038.zip
let user choose notification email in user settings
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/settings/src/service')
-rw-r--r--apps/settings/src/service/PersonalInfo/EmailService.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/settings/src/service/PersonalInfo/EmailService.js b/apps/settings/src/service/PersonalInfo/EmailService.js
index 00e2373736c..a1f7a57f72b 100644
--- a/apps/settings/src/service/PersonalInfo/EmailService.js
+++ b/apps/settings/src/service/PersonalInfo/EmailService.js
@@ -70,6 +70,26 @@ export const saveAdditionalEmail = async(email) => {
}
/**
+ * Save the notification email of the user
+ *
+ * @param {string} email the notification email
+ * @returns {object}
+ */
+export const saveNotificationEmail = async(email) => {
+ const userId = getCurrentUser().uid
+ const url = generateOcsUrl('cloud/users/{userId}', { userId })
+
+ await confirmPassword()
+
+ const res = await axios.put(url, {
+ key: ACCOUNT_PROPERTY_ENUM.NOTIFICATION_EMAIL,
+ value: email,
+ })
+
+ return res.data
+}
+
+/**
* Remove an additional email of the user
*
* @param {string} email the additional email