summaryrefslogtreecommitdiffstats
path: root/apps/settings/src
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-02-26 18:04:43 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-02-28 14:01:03 +0100
commitd47daefe387301c9df8afabd00d5e547429d8709 (patch)
tree6ab11f0bb3349496ef30308f5ac2b187d0beb7fa /apps/settings/src
parent0f08acfe3169e3ef0c332353324271bd86c2e525 (diff)
downloadnextcloud-server-d47daefe387301c9df8afabd00d5e547429d8709.tar.gz
nextcloud-server-d47daefe387301c9df8afabd00d5e547429d8709.zip
Revive the "send email to new users" toggle for the user form
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/settings/src')
-rw-r--r--apps/settings/src/views/Users.vue31
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 : []