2013-05-19 23:17:32 +00:00
|
|
|
|
using System;
|
2013-02-24 23:47:57 +00:00
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
2013-05-19 23:17:32 +00:00
|
|
|
|
namespace NzbDrone.Core.Notifications.Smtp
|
2013-02-24 23:47:57 +00:00
|
|
|
|
{
|
2013-05-19 23:17:32 +00:00
|
|
|
|
public class Smtp : NotificationWithSetting<SmtpSettings>
|
2013-02-24 23:47:57 +00:00
|
|
|
|
{
|
|
|
|
|
private readonly SmtpProvider _smtpProvider;
|
|
|
|
|
|
2013-05-19 23:17:32 +00:00
|
|
|
|
public Smtp(SmtpProvider smtpProvider)
|
2013-02-24 23:47:57 +00:00
|
|
|
|
{
|
|
|
|
|
_smtpProvider = smtpProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "SMTP"; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-19 23:17:32 +00:00
|
|
|
|
public override void OnGrab(string message)
|
2013-02-24 23:47:57 +00:00
|
|
|
|
{
|
|
|
|
|
const string subject = "NzbDrone [TV] - Grabbed";
|
|
|
|
|
var body = String.Format("{0} sent to SABnzbd queue.", message);
|
2013-05-19 23:17:32 +00:00
|
|
|
|
|
|
|
|
|
_smtpProvider.SendEmail(Settings, subject, body);
|
2013-02-24 23:47:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-05-19 23:17:32 +00:00
|
|
|
|
public override void OnDownload(string message, Series series)
|
2013-02-24 23:47:57 +00:00
|
|
|
|
{
|
|
|
|
|
const string subject = "NzbDrone [TV] - Downloaded";
|
|
|
|
|
var body = String.Format("{0} Downloaded and sorted.", message);
|
|
|
|
|
|
2013-05-19 23:17:32 +00:00
|
|
|
|
_smtpProvider.SendEmail(Settings, subject, body);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void AfterRename(Series series)
|
|
|
|
|
{
|
2013-02-24 23:47:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|