From d47daefe387301c9df8afabd00d5e547429d8709 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 26 Feb 2020 18:04:43 +0100 Subject: Revive the "send email to new users" toggle for the user form Signed-off-by: Christoph Wurst --- apps/settings/src/views/Users.vue | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'apps/settings/src') diff --git a/apps/settings/src/views/Users.vue b/apps/settings/src/views/Users.vue index 01fb9a9b48a..284317f2588 100644 --- a/apps/settings/src/views/Users.vue +++ b/apps/settings/src/views/Users.vue @@ -135,6 +135,14 @@ class="checkbox"> +
+ + +
@@ -156,7 +164,9 @@ import AppNavigationCounter from '@nextcloud/vue/dist/Components/AppNavigationCo import AppNavigationItem from '@nextcloud/vue/dist/Components/AppNavigationItem' import AppNavigationNew from '@nextcloud/vue/dist/Components/AppNavigationNew' import AppNavigationSettings from '@nextcloud/vue/dist/Components/AppNavigationSettings' +import axios from '@nextcloud/axios' import Content from '@nextcloud/vue/dist/Components/Content' +import { generateUrl } from '@nextcloud/router' import Multiselect from '@nextcloud/vue/dist/Components/Multiselect' import Vue from 'vue' import VueLocalStorage from 'vue-localstorage' @@ -194,6 +204,7 @@ export default { selectedQuota: false, externalActions: [], loadingAddGroup: false, + loadingSendMail: false, showConfig: { showStoragePath: false, showUserBackend: false, @@ -276,6 +287,26 @@ export default { }, + sendWelcomeMail: { + get() { + return this.settings.newUserSendEmail + }, + async set(value) { + try { + this.loadingSendMail = true + this.$store.commit('setServerData', { + ...this.settings, + newUserSendEmail: value, + }) + await axios.post(generateUrl(`/settings/users/preferences/newUser.sendEmail`), { value: value ? 'yes' : 'no' }) + } catch (e) { + console.error('could not update newUser.sendEmail preference: ' + e.message, e) + } finally { + this.loadingSendMail = false + } + }, + }, + groupList() { const groups = Array.isArray(this.groups) ? this.groups : [] -- cgit v1.2.3