2013-05-20 01:17:32 +02:00
|
|
|
|
using System;
|
2013-02-25 00:47:57 +01:00
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
2013-05-27 07:44:54 +02:00
|
|
|
|
namespace NzbDrone.Core.Notifications.Email
|
2013-02-25 00:47:57 +01:00
|
|
|
|
{
|
2013-05-27 07:44:54 +02:00
|
|
|
|
public class Email : NotificationBase<EmailSettings>
|
2013-02-25 00:47:57 +01:00
|
|
|
|
{
|
2013-06-13 08:41:26 +02:00
|
|
|
|
private readonly IEmailService _smtpProvider;
|
2013-02-25 00:47:57 +01:00
|
|
|
|
|
2013-06-13 08:41:26 +02:00
|
|
|
|
public Email(IEmailService smtpProvider)
|
2013-02-25 00:47:57 +01:00
|
|
|
|
{
|
|
|
|
|
_smtpProvider = smtpProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
2013-05-27 07:27:33 +02:00
|
|
|
|
get { return "Email"; }
|
2013-02-25 00:47:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-06-13 08:41:26 +02:00
|
|
|
|
public override string ImplementationName
|
|
|
|
|
{
|
|
|
|
|
get { return "Email"; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-20 01:17:32 +02:00
|
|
|
|
public override void OnGrab(string message)
|
2013-02-25 00:47:57 +01:00
|
|
|
|
{
|
|
|
|
|
const string subject = "NzbDrone [TV] - Grabbed";
|
|
|
|
|
var body = String.Format("{0} sent to SABnzbd queue.", message);
|
2013-05-20 01:17:32 +02:00
|
|
|
|
|
|
|
|
|
_smtpProvider.SendEmail(Settings, subject, body);
|
2013-02-25 00:47:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
2013-05-20 01:17:32 +02:00
|
|
|
|
public override void OnDownload(string message, Series series)
|
2013-02-25 00:47:57 +01:00
|
|
|
|
{
|
|
|
|
|
const string subject = "NzbDrone [TV] - Downloaded";
|
|
|
|
|
var body = String.Format("{0} Downloaded and sorted.", message);
|
|
|
|
|
|
2013-05-20 01:17:32 +02:00
|
|
|
|
_smtpProvider.SendEmail(Settings, subject, body);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void AfterRename(Series series)
|
|
|
|
|
{
|
2013-02-25 00:47:57 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|