mirror of https://github.com/Ombi-app/Ombi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
118 lines
4.7 KiB
118 lines
4.7 KiB
8 years ago
|
@using System.Linq
|
||
8 years ago
|
@using Ombi.UI.Helpers
|
||
|
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Ombi.Core.SettingModels.NewletterSettings>
|
||
8 years ago
|
@Html.Partial("Shared/Partial/_Sidebar")
|
||
8 years ago
|
|
||
|
<div class="col-sm-8 col-sm-push-1">
|
||
|
<form class="form-horizontal" method="POST" id="mainForm">
|
||
|
<fieldset>
|
||
|
<legend>Newsletter Settings</legend>
|
||
8 years ago
|
<div style="padding:10px">
|
||
8 years ago
|
|
||
8 years ago
|
<!-- Newsletter Section -->
|
||
8 years ago
|
<div class="form-group">
|
||
|
<div class="checkbox">
|
||
8 years ago
|
|
||
8 years ago
|
<small>Note: This will require you to setup your email notifications
|
||
|
</small><span class="customTooltip" title="It also requires users to have the Newsletter feature"><i class="fa fa-info-circle"></i></span>
|
||
8 years ago
|
<br />
|
||
8 years ago
|
<br />
|
||
|
@Html.Checkbox(Model.SendRecentlyAddedEmail, "SendRecentlyAddedEmail", "Enable newsletter")
|
||
8 years ago
|
</div>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
<div class="form-group">
|
||
|
|
||
|
<br>
|
||
|
<label for="CustomUsers" class="control-label">Email Addresses to Send to (For users that are not in your User Management section)</label>
|
||
|
<small>You can add multiple email addresses by using the ; delimiter</small>
|
||
|
<div>
|
||
|
<input type="text" class="form-control form-control-custom " placeholder="first@address.com;second@address.com" id="CustomUsers" name="CustomUsers" value="@Model.CustomUsers">
|
||
|
</div>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
|
||
8 years ago
|
<div class="form-group">
|
||
|
<div>
|
||
8 years ago
|
|
||
8 years ago
|
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin @Html.ToolTip("Note: If there is nothing new when testing this, we will just grab some random titles. If there are new items, then we will show those new items. Testing will not mark the content as 'Previously Sent'")
|
||
8 years ago
|
<div id="testEmailSpinner"></div></button>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
</div>
|
||
8 years ago
|
|
||
8 years ago
|
<br />
|
||
|
<br />
|
||
|
<div class="form-group">
|
||
|
<div>
|
||
|
<button type="submit" id="save" class="btn btn-primary-outline">Save</button>
|
||
|
</div>
|
||
8 years ago
|
</div>
|
||
|
</div>
|
||
8 years ago
|
<!-- Newsletter Section -->
|
||
8 years ago
|
</fieldset>
|
||
|
</form>
|
||
8 years ago
|
</div>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
$(function () {
|
||
8 years ago
|
$('.customTooltip').tooltipster({
|
||
|
contentCloning: true
|
||
|
});
|
||
|
|
||
8 years ago
|
var base = '@Html.GetBaseUrl()';
|
||
|
$('#save').click(function (e) {
|
||
|
e.preventDefault();
|
||
|
|
||
|
var $form = $("#mainForm");
|
||
|
var data = $form.serialize();
|
||
|
|
||
|
$.ajax({
|
||
|
type: $form.prop("method"),
|
||
|
data: data,
|
||
|
url: $form.prop("action"),
|
||
|
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");
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
8 years ago
|
$('#recentlyAddedBtn').click(function (e) {
|
||
|
e.preventDefault();
|
||
8 years ago
|
|
||
|
generateNotify("This could take some time depending on if you have episode searching enabled and also how many new items have been added!", "info");
|
||
8 years ago
|
var base = '@Html.GetBaseUrl()';
|
||
8 years ago
|
var url = createBaseUrl(base, '/admin/testnewsletteradminemail');
|
||
|
$('#testEmailSpinner').attr("class", "fa fa-spinner fa-spin");
|
||
|
$.ajax({
|
||
|
type: "post",
|
||
|
url: url,
|
||
|
dataType: "json",
|
||
|
success: function (response) {
|
||
|
if (response) {
|
||
|
generateNotify(response.message, "success");
|
||
8 years ago
|
$('#testEmailSpinner').attr("class", "fa fa-check");
|
||
8 years ago
|
} else {
|
||
|
|
||
|
generateNotify(response.message, "danger");
|
||
8 years ago
|
$('#testEmailSpinner').attr("class", "fa fa-times");
|
||
8 years ago
|
}
|
||
|
},
|
||
|
error: function (e) {
|
||
|
console.log(e);
|
||
|
generateNotify("Something went wrong!", "danger");
|
||
8 years ago
|
$('#testSendMassEmailSpinner').attr("class", "fa fa-times");
|
||
8 years ago
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
8 years ago
|
});
|
||
8 years ago
|
</script>
|