mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 17:22:54 -07:00
parent
8cbf2ab707
commit
b2d5996d52
17 changed files with 184 additions and 33 deletions
|
@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Ombi.Core.Settings;
|
||||
using Ombi.Helpers;
|
||||
using Ombi.Notifications.Exceptions;
|
||||
using Ombi.Notifications.Models;
|
||||
using Ombi.Settings.Settings.Models;
|
||||
using Ombi.Store.Entities;
|
||||
|
@ -134,9 +135,13 @@ namespace Ombi.Notifications.Interfaces
|
|||
protected virtual async Task<NotificationMessageContent> LoadTemplate(NotificationAgent agent, NotificationType type, NotificationOptions model)
|
||||
{
|
||||
var template = await TemplateRepository.GetTemplate(agent, type);
|
||||
if (template == null)
|
||||
{
|
||||
throw new TemplateMissingException($"The template for {agent} and type {type} is missing");
|
||||
}
|
||||
if (!template.Enabled)
|
||||
{
|
||||
return null;
|
||||
return new NotificationMessageContent {Disabled = true};
|
||||
}
|
||||
var parsed = Parse(model, template);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue