Added first implimentation of the Notification Service #8

Added tests to cover the notification service
This commit is contained in:
tidusjar 2016-03-17 13:32:58 +00:00
parent aa5304b8dd
commit b9a886d5dc
13 changed files with 410 additions and 10 deletions

View file

@ -40,6 +40,7 @@ using PlexRequests.Api.Interfaces;
using PlexRequests.Core;
using PlexRequests.Core.SettingModels;
using PlexRequests.Helpers;
using PlexRequests.Services.Notification;
using PlexRequests.UI.Helpers;
using PlexRequests.UI.Models;
@ -302,8 +303,13 @@ namespace PlexRequests.UI.Modules
Log.Trace(settings.DumpJson());
var result = EmailService.SaveSettings(settings);
NotificationService.Subscribe(new EmailMessageNotification(EmailService));
Log.Info("Saved email settings, result: {0}", result);
return Context.GetRedirect("~/admin/emailnotification");
return Response.AsJson(result
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Email Notifications!" }
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
}
private Negotiator Status()