diff options
Diffstat (limited to 'apps/settings/src/views')
-rw-r--r-- | apps/settings/src/views/Users.vue | 31 |
1 files changed, 31 insertions, 0 deletions
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"> <label for="showStoragePath">{{ t('settings', 'Show storage path') }}</label> </div> + <div> + <input id="sendWelcomeMail" + v-model="sendWelcomeMail" + :disabled="loadingSendMail" + type="checkbox" + class="checkbox"> + <label for="sendWelcomeMail">{{ t('settings', 'Send email to new user') }}</label> + </div> </AppNavigationSettings> </AppNavigation> <AppContent> @@ -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 : [] |