mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 21:51:13 -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
|
@ -51,6 +51,7 @@ using PlexRequests.Store.Models;
|
|||
using PlexRequests.Store.Repository;
|
||||
using PlexRequests.UI.Helpers;
|
||||
using PlexRequests.UI.Models;
|
||||
using System;
|
||||
|
||||
namespace PlexRequests.UI.Modules
|
||||
{
|
||||
|
@ -139,6 +140,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Get["/emailnotification"] = _ => EmailNotifications();
|
||||
Post["/emailnotification"] = _ => SaveEmailNotifications();
|
||||
Post["/testemailnotification"] = _ => TestEmailNotifications();
|
||||
Get["/status"] = _ => Status();
|
||||
|
||||
Get["/pushbulletnotification"] = _ => PushbulletNotifications();
|
||||
|
@ -372,6 +374,19 @@ namespace PlexRequests.UI.Modules
|
|||
return View["EmailNotifications", settings];
|
||||
}
|
||||
|
||||
private Response TestEmailNotifications()
|
||||
{
|
||||
var settings = this.Bind<EmailNotificationSettings>();
|
||||
var notificationModel = new NotificationModel
|
||||
{
|
||||
NotificationType = NotificationType.Test,
|
||||
DateTime = DateTime.Now
|
||||
};
|
||||
NotificationService.Publish(notificationModel, settings);
|
||||
Log.Info("Sent email notification test");
|
||||
return Response.AsJson(new JsonResponseModel { Result = true, Message = "Successfully sent a test Email Notification!" });
|
||||
}
|
||||
|
||||
private Response SaveEmailNotifications()
|
||||
{
|
||||
var settings = this.Bind<EmailNotificationSettings>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue