added test email

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2025-03-20 10:34:24 -06:00
parent 9920bd472f
commit 7c8c3fb1c8
4 changed files with 61 additions and 2 deletions

View File

@@ -94,6 +94,33 @@ function updateSettings() {
}
})
}
function sendTestEmail() {
Swal.fire({
title: 'Send Test Email',
html: `
<input type="text" id="testEmailRecipient" class="swal2-input" placeholder="Email Address" onkeydown="handleSwalEnter(event)">
`,
confirmButtonText: 'Send',
focusConfirm: false,
preConfirm: () => {
const emailRecipient = $("#testEmailRecipient").val();
if (!emailRecipient || emailRecipient.trim() == '') {
Swal.showValidationMessage(`Please enter a valid email address`);
}
return { emailRecipient }
},
}).then(function (result) {
if (result.isConfirmed) {
$.post('/Home/SendTestEmail', { emailAddress: result.value.emailRecipient }, function (data) {
if (data.success) {
successToast(data.message);
} else {
errorToast(data.message);
}
});
}
});
}
function makeBackup() {
$.get('/Files/MakeBackup', function (data) {
window.location.href = data;