From 2274873b12aadf2bab4265ffa8f4f025bccdfbb3 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 23 Aug 2020 02:28:10 +0000 Subject: [PATCH] add email test --- .../modals/coresettings/EditCoreSettings.vue | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/components/modals/coresettings/EditCoreSettings.vue b/src/components/modals/coresettings/EditCoreSettings.vue index 5c4e4fd..62d421f 100644 --- a/src/components/modals/coresettings/EditCoreSettings.vue +++ b/src/components/modals/coresettings/EditCoreSettings.vue @@ -178,6 +178,14 @@ + @@ -202,6 +210,7 @@ export default { splitterModel: 15, isPwd: true, allTimezones: [], + emailTest: false, thumbStyle: { right: "2px", borderRadius: "5px", @@ -246,8 +255,23 @@ export default { .patch("/core/editsettings/", this.settings) .then(r => { this.$q.loading.hide(); - this.notifySuccess("Settings were edited!"); - this.$emit("close"); + if (this.emailTest) { + this.$q.loading.show({ message: "Sending test email..." }); + this.$axios + .get("/core/emailtest/") + .then(r => { + this.$q.loading.hide(); + this.getCoreSettings(); + this.notifySuccess(r.data, 3000); + }) + .catch(e => { + this.$q.loading.hide(); + this.notifyError(e.response.data, 7000); + }); + } else { + this.$emit("close"); + this.notifySuccess("Settings were edited!"); + } }) .catch(() => { this.$q.loading.hide();