#1914 for the issue resolved notification

This commit is contained in:
Jamie 2018-01-22 08:31:50 +00:00
parent 2551175867
commit 48ec5d700c
12 changed files with 149 additions and 20 deletions

View file

@ -69,7 +69,7 @@ namespace Ombi.Notifications.Agents
await Send(notification, settings);
}
protected override async Task Issue(NotificationOptions model, SlackNotificationSettings settings)
protected override async Task NewIssue(NotificationOptions model, SlackNotificationSettings settings)
{
var parsed = await LoadTemplate(NotificationAgent.Slack, NotificationType.Issue, model);
if (parsed.Disabled)
@ -85,6 +85,22 @@ namespace Ombi.Notifications.Agents
await Send(notification, settings);
}
protected override async Task IssueResolved(NotificationOptions model, SlackNotificationSettings settings)
{
var parsed = await LoadTemplate(NotificationAgent.Slack, NotificationType.IssueResolved, model);
if (parsed.Disabled)
{
Logger.LogInformation($"Template {NotificationType.IssueResolved} is disabled for {NotificationAgent.Slack}");
return;
}
var notification = new NotificationMessage
{
Message = parsed.Message,
};
notification.Other.Add("image", parsed.Image);
await Send(notification, settings);
}
protected override async Task AddedToRequestQueue(NotificationOptions model, SlackNotificationSettings settings)
{
var user = string.Empty;