|
|
@ -92,6 +92,7 @@ namespace Ombi.UI.Modules.Admin
|
|
|
|
private IJobRecord JobRecorder { get; }
|
|
|
|
private IJobRecord JobRecorder { get; }
|
|
|
|
private IAnalytics Analytics { get; }
|
|
|
|
private IAnalytics Analytics { get; }
|
|
|
|
private IRecentlyAdded RecentlyAdded { get; }
|
|
|
|
private IRecentlyAdded RecentlyAdded { get; }
|
|
|
|
|
|
|
|
private IMassEmail MassEmail { get; }
|
|
|
|
private ISettingsService<NotificationSettingsV2> NotifySettings { get; }
|
|
|
|
private ISettingsService<NotificationSettingsV2> NotifySettings { get; }
|
|
|
|
private ISettingsService<DiscordNotificationSettings> DiscordSettings { get; }
|
|
|
|
private ISettingsService<DiscordNotificationSettings> DiscordSettings { get; }
|
|
|
|
private IDiscordApi DiscordApi { get; }
|
|
|
|
private IDiscordApi DiscordApi { get; }
|
|
|
@ -222,6 +223,9 @@ namespace Ombi.UI.Modules.Admin
|
|
|
|
|
|
|
|
|
|
|
|
Get["/newsletter", true] = async (x, ct) => await Newsletter();
|
|
|
|
Get["/newsletter", true] = async (x, ct) => await Newsletter();
|
|
|
|
Post["/newsletter", true] = async (x, ct) => await SaveNewsletter();
|
|
|
|
Post["/newsletter", true] = async (x, ct) => await SaveNewsletter();
|
|
|
|
|
|
|
|
Post["/testnewsletteradminemail"] = x => TestNewsletterAdminEmail();
|
|
|
|
|
|
|
|
Post["/testmassadminemail"] = x => TestMassAdminEmail();
|
|
|
|
|
|
|
|
Post["/sendmassemail"] = x => SendMassEmail();
|
|
|
|
|
|
|
|
|
|
|
|
Post["/createapikey"] = x => CreateApiKey();
|
|
|
|
Post["/createapikey"] = x => CreateApiKey();
|
|
|
|
|
|
|
|
|
|
|
@ -246,7 +250,6 @@ namespace Ombi.UI.Modules.Admin
|
|
|
|
Get["/notificationsettings", true] = async (x, ct) => await NotificationSettings();
|
|
|
|
Get["/notificationsettings", true] = async (x, ct) => await NotificationSettings();
|
|
|
|
Post["/notificationsettings"] = x => SaveNotificationSettings();
|
|
|
|
Post["/notificationsettings"] = x => SaveNotificationSettings();
|
|
|
|
|
|
|
|
|
|
|
|
Post["/recentlyAddedTest"] = x => RecentlyAddedTest();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async Task<Negotiator> Authentication()
|
|
|
|
private async Task<Negotiator> Authentication()
|
|
|
@ -1229,13 +1232,41 @@ namespace Ombi.UI.Modules.Admin
|
|
|
|
var model = this.Bind<NotificationSettingsV2>();
|
|
|
|
var model = this.Bind<NotificationSettingsV2>();
|
|
|
|
return View["NotificationSettings", model];
|
|
|
|
return View["NotificationSettings", model];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Response RecentlyAddedTest()
|
|
|
|
private Response TestNewsletterAdminEmail()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Debug("Clicked Admin Newsletter Email Test");
|
|
|
|
|
|
|
|
RecentlyAdded.RecentlyAddedAdminTest();
|
|
|
|
|
|
|
|
return Response.AsJson(new JsonResponseModel { Result = true, Message = "Sent email to administrator" });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Error(e);
|
|
|
|
|
|
|
|
return Response.AsJson(new JsonResponseModel { Result = false, Message = e.Message });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private Response TestMassAdminEmail()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Debug("Clicked Admin Mass Email Test");
|
|
|
|
|
|
|
|
RecentlyAdded.RecentlyAddedAdminTest();
|
|
|
|
|
|
|
|
return Response.AsJson(new JsonResponseModel { Result = true, Message = "Sent email to administrator" });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.Error(e);
|
|
|
|
|
|
|
|
return Response.AsJson(new JsonResponseModel { Result = false, Message = e.Message });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private Response SendMassEmail()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Debug("Clicked TEST");
|
|
|
|
Log.Debug("Clicked Send Mass Email");
|
|
|
|
RecentlyAdded.Test();
|
|
|
|
RecentlyAdded.RecentlyAddedAdminTest();
|
|
|
|
return Response.AsJson(new JsonResponseModel { Result = true, Message = "Sent email to administrator" });
|
|
|
|
return Response.AsJson(new JsonResponseModel { Result = true, Message = "Sent email to administrator" });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|