mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
Begin Implementing Mass Email Section
This commit is contained in:
parent
0b64618438
commit
16823e2739
6 changed files with 110 additions and 18 deletions
|
@ -92,6 +92,7 @@ namespace Ombi.UI.Modules.Admin
|
|||
private IJobRecord JobRecorder { get; }
|
||||
private IAnalytics Analytics { get; }
|
||||
private IRecentlyAdded RecentlyAdded { get; }
|
||||
private IMassEmail MassEmail { get; }
|
||||
private ISettingsService<NotificationSettingsV2> NotifySettings { get; }
|
||||
private ISettingsService<DiscordNotificationSettings> DiscordSettings { get; }
|
||||
private IDiscordApi DiscordApi { get; }
|
||||
|
@ -222,6 +223,9 @@ namespace Ombi.UI.Modules.Admin
|
|||
|
||||
Get["/newsletter", true] = async (x, ct) => await Newsletter();
|
||||
Post["/newsletter", true] = async (x, ct) => await SaveNewsletter();
|
||||
Post["/testnewsletteradminemail"] = x => TestNewsletterAdminEmail();
|
||||
Post["/testmassadminemail"] = x => TestMassAdminEmail();
|
||||
Post["/sendmassemail"] = x => SendMassEmail();
|
||||
|
||||
Post["/createapikey"] = x => CreateApiKey();
|
||||
|
||||
|
@ -246,7 +250,6 @@ namespace Ombi.UI.Modules.Admin
|
|||
Get["/notificationsettings", true] = async (x, ct) => await NotificationSettings();
|
||||
Post["/notificationsettings"] = x => SaveNotificationSettings();
|
||||
|
||||
Post["/recentlyAddedTest"] = x => RecentlyAddedTest();
|
||||
}
|
||||
|
||||
private async Task<Negotiator> Authentication()
|
||||
|
@ -1229,13 +1232,41 @@ namespace Ombi.UI.Modules.Admin
|
|||
var model = this.Bind<NotificationSettingsV2>();
|
||||
return View["NotificationSettings", model];
|
||||
}
|
||||
|
||||
private Response RecentlyAddedTest()
|
||||
|
||||
private Response TestNewsletterAdminEmail()
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.Debug("Clicked TEST");
|
||||
RecentlyAdded.Test();
|
||||
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
|
||||
{
|
||||
Log.Debug("Clicked Send Mass Email");
|
||||
RecentlyAdded.RecentlyAddedAdminTest();
|
||||
return Response.AsJson(new JsonResponseModel { Result = true, Message = "Sent email to administrator" });
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue