Payment reminder mails
This commit is contained in:
@@ -4,6 +4,7 @@ import {useAjax} from "../../../../../resources/js/components/ajaxHandler.js";
|
||||
import TextEditor from "../../../../Views/Components/TextEditor.vue";
|
||||
import ErrorText from "../../../../Views/Components/ErrorText.vue";
|
||||
import {toast} from "vue3-toastify";
|
||||
import InfoText from "../../../../Views/Components/InfoText.vue";
|
||||
const { request } = useAjax();
|
||||
|
||||
|
||||
@@ -37,6 +38,7 @@ onMounted(async () => {
|
||||
});
|
||||
|
||||
const errorMessage = ref(null)
|
||||
const infoMessage = ref(null)
|
||||
|
||||
const emit = defineEmits([
|
||||
'closeComposer',
|
||||
@@ -49,6 +51,10 @@ function close() {
|
||||
|
||||
|
||||
async function sendMail() {
|
||||
document.getElementById('sendMessageButton').style.display = 'none';
|
||||
infoMessage.value = 'Die Rundmail wird nun gesendet. Dies kann einen Moment dauern. Bitte verlasse diese Seite nicht.'
|
||||
|
||||
toast.info('Die Rundmail wird nun gesendet. Dies kann einen Moment dauern. Bitte verlasse diese Seite nicht.')
|
||||
const response = await request('/api/v1/event/' + props.event.identifier + '/mailing/send', {
|
||||
method: "POST",
|
||||
body: {
|
||||
@@ -59,10 +65,14 @@ async function sendMail() {
|
||||
});
|
||||
|
||||
if (response.success) {
|
||||
infoMessage.value = null
|
||||
document.getElementById('sendMessageButton').style.display = 'block';
|
||||
close();
|
||||
toast.success(response.message)
|
||||
|
||||
} else {
|
||||
infoMessage.value = null
|
||||
document.getElementById('sendMessageButton').style.display = 'block';
|
||||
errorMessage.value = response.message
|
||||
toast.error(response.message)
|
||||
}
|
||||
@@ -94,8 +104,8 @@ const form = reactive({
|
||||
<strong><ErrorText :message="errorMessage" /></strong>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="button" @click="sendMail" value="Senden" class="" />
|
||||
<info-text :message="infoMessage" />
|
||||
<input type="button" id="sendMessageButton" @click="sendMail" value="Senden" class="" />
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import Modal from "../../../../Views/Components/Modal.vue";
|
||||
import MailCompose from "./MailCompose.vue";
|
||||
import FullScreenModal from "../../../../Views/Components/FullScreenModal.vue";
|
||||
import {toast} from "vue3-toastify";
|
||||
|
||||
const props = defineProps({
|
||||
data: Object,
|
||||
@@ -54,6 +55,17 @@
|
||||
function mailToGroup() {
|
||||
mailCompose.value = true
|
||||
}
|
||||
|
||||
async function sendPaymentReminder() {
|
||||
toast.info("Die Nachrichten werden gesendet. Bitte verlasse diese Seite nicht.");
|
||||
const response = await fetch("/api/v1/event/" + props.data.event.identifier + "/send-payment-reminder/" );
|
||||
const data = await response.json();
|
||||
if (data.success) {
|
||||
toast.success(data.message)
|
||||
} else {
|
||||
toast.error(data.message)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -90,8 +102,8 @@
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
||||
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
||||
</a><br/>
|
||||
<input type="button" class="fix-button" value="Zahlungserinnerung senden" /><br/>
|
||||
<input type="button" class="deny-button" value="Letzte Mahnung senden" /><br/>
|
||||
<input type="button" @click="sendPaymentReminder" class="fix-button" value="Zahlungserinnerung senden" /><br/>
|
||||
<input type="button" class="deny-button" value="Letzte Mahnung senden" style="display: none" /><br/>
|
||||
<input type="button" value="Rundmail senden" @click="mailToGroup" /><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user