mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
external notifications are now based on Events.
This commit is contained in:
parent
a866c419e1
commit
5fc25b6095
32 changed files with 542 additions and 619 deletions
39
NzbDrone.Core/ExternalNotification/Smtp.cs
Normal file
39
NzbDrone.Core/ExternalNotification/Smtp.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System.Linq;
|
||||
using System;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.ExternalNotification
|
||||
{
|
||||
public class Smtp : ExternalNotificationBase
|
||||
{
|
||||
private readonly SmtpProvider _smtpProvider;
|
||||
|
||||
public Smtp(IExternalNotificationRepository repository, SmtpProvider smtpProvider, Logger logger)
|
||||
: base(repository, logger)
|
||||
{
|
||||
_smtpProvider = smtpProvider;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "SMTP"; }
|
||||
}
|
||||
|
||||
protected override void OnGrab(string message)
|
||||
{
|
||||
const string subject = "NzbDrone [TV] - Grabbed";
|
||||
var body = String.Format("{0} sent to SABnzbd queue.", message);
|
||||
_smtpProvider.SendEmail(subject, body);
|
||||
}
|
||||
|
||||
protected override void OnDownload(string message, Series series)
|
||||
{
|
||||
const string subject = "NzbDrone [TV] - Downloaded";
|
||||
var body = String.Format("{0} Downloaded and sorted.", message);
|
||||
|
||||
_smtpProvider.SendEmail(subject, body);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue