mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
#96 Email notification test button (others to come)
This commit is contained in:
parent
085c46ce43
commit
4b3f79b4a8
9 changed files with 134 additions and 18 deletions
|
@ -88,6 +88,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="testEmail" type="submit" class="btn btn-primary-outline">Test</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
|
@ -128,7 +133,32 @@
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
$('#testEmail').click(function (e) {
|
||||
e.preventDefault();
|
||||
var port = $('#EmailPort').val();
|
||||
if (isNaN(port)) {
|
||||
generateNotify("You must specify a valid Port.", "warning");
|
||||
return;
|
||||
}
|
||||
var $form = $("#mainForm");
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: $form.serialize(),
|
||||
url: '/admin/testemailnotification',
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue