added ability to notify user that they have a registration token.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-13 11:48:20 -07:00
parent c9d60910e5
commit 2247b1b1db
6 changed files with 110 additions and 38 deletions

View File

@@ -6,6 +6,10 @@
<div class="row">
<div class="col-5">
<div class="row">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="enableAutoNotify" checked>
<label class="form-check-label" for="enableAutoNotify">Auto Notify(via Email)</label>
</div>
<button onclick="generateNewToken()" class="btn btn-primary btn-md mt-1 mb-1"><i class="bi bi-pencil-square me-2"></i>Generate User Token</button>
</div>
<table class="table table-hover">
@@ -88,11 +92,12 @@
},
}).then(function (result) {
if (result.isConfirmed) {
$.get('/Admin/GenerateNewToken', {emailAddress: result.value.emailAddress}, function (data) {
if (data) {
var autoNotify = $("#enableAutoNotify").is(":checked");
$.get('/Admin/GenerateNewToken', {emailAddress: result.value.emailAddress, autoNotify: autoNotify}, function (data) {
if (data.success) {
reloadPage();
} else {
errorToast("An error occurred, make sure the email address doesn't already have a token generated for it.")
errorToast(data.message)
}
});
}