diff --git a/NzbDrone.Core.Test/NotificationTests/NotificationServiceFixture.cs b/NzbDrone.Core.Test/NotificationTests/NotificationServiceFixture.cs index f3dea7777..8ad4812f4 100644 --- a/NzbDrone.Core.Test/NotificationTests/NotificationServiceFixture.cs +++ b/NzbDrone.Core.Test/NotificationTests/NotificationServiceFixture.cs @@ -7,10 +7,10 @@ using NUnit.Framework; using NzbDrone.Common.Composition; using NzbDrone.Core.Lifecycle; using NzbDrone.Core.Notifications; +using NzbDrone.Core.Notifications.Email; using NzbDrone.Core.Notifications.Growl; using NzbDrone.Core.Notifications.Plex; using NzbDrone.Core.Notifications.Prowl; -using NzbDrone.Core.Notifications.Smtp; using NzbDrone.Core.Notifications.Xbmc; using NzbDrone.Core.Test.Framework; @@ -28,7 +28,7 @@ namespace NzbDrone.Core.Test.NotificationTests _notifications.Add(new Xbmc(null, null)); _notifications.Add(new PlexClient(null)); _notifications.Add(new PlexServer(null)); - _notifications.Add(new Smtp(null)); + _notifications.Add(new Email(null)); _notifications.Add(new Growl(null)); _notifications.Add(new Prowl(null)); @@ -58,8 +58,8 @@ namespace NzbDrone.Core.Test.NotificationTests Mocker.GetMock().Setup(s => s.Resolve(typeof(PlexServer))) .Returns(new PlexServer(null)); - Mocker.GetMock().Setup(s => s.Resolve(typeof(Smtp))) - .Returns(new Smtp(null)); + Mocker.GetMock().Setup(s => s.Resolve(typeof(Email))) + .Returns(new Email(null)); Mocker.GetMock().Setup(s => s.Resolve(typeof(Growl))) .Returns(new Growl(null)); diff --git a/NzbDrone.Core/Notifications/Smtp/Smtp.cs b/NzbDrone.Core/Notifications/Email/Email.cs similarity index 78% rename from NzbDrone.Core/Notifications/Smtp/Smtp.cs rename to NzbDrone.Core/Notifications/Email/Email.cs index 04ba117a4..6e470bcb4 100644 --- a/NzbDrone.Core/Notifications/Smtp/Smtp.cs +++ b/NzbDrone.Core/Notifications/Email/Email.cs @@ -1,15 +1,13 @@ using System; -using NLog; -using NzbDrone.Core.Providers; using NzbDrone.Core.Tv; -namespace NzbDrone.Core.Notifications.Smtp +namespace NzbDrone.Core.Notifications.Email { - public class Smtp : NotificationBase + public class Email : NotificationBase { - private readonly SmtpProvider _smtpProvider; + private readonly EmailProvider _smtpProvider; - public Smtp(SmtpProvider smtpProvider) + public Email(EmailProvider smtpProvider) { _smtpProvider = smtpProvider; } diff --git a/NzbDrone.Core/Notifications/Smtp/SmtpProvider.cs b/NzbDrone.Core/Notifications/Email/EmailProvider.cs similarity index 77% rename from NzbDrone.Core/Notifications/Smtp/SmtpProvider.cs rename to NzbDrone.Core/Notifications/Email/EmailProvider.cs index 694b91830..744ac1c7b 100644 --- a/NzbDrone.Core/Notifications/Smtp/SmtpProvider.cs +++ b/NzbDrone.Core/Notifications/Email/EmailProvider.cs @@ -3,20 +3,18 @@ using System.Net; using System.Net.Mail; using NLog; -namespace NzbDrone.Core.Notifications.Smtp +namespace NzbDrone.Core.Notifications.Email { - public class SmtpProvider + public class EmailProvider { private readonly Logger _logger; - public SmtpProvider(Logger logger) + public EmailProvider(Logger logger) { _logger = logger; } -// var subject = "NzbDrone SMTP Test Notification"; -// var body = "This is a test email from NzbDrone, if you received this message you properly configured your SMTP settings! (Now save them!)"; - public virtual void SendEmail(SmtpSettings settings, string subject, string body, bool htmlBody = false) + public virtual void SendEmail(EmailSettings settings, string subject, string body, bool htmlBody = false) { var email = new MailMessage(); email.From = new MailAddress(settings.From); diff --git a/NzbDrone.Core/Notifications/Smtp/SmtpSettings.cs b/NzbDrone.Core/Notifications/Email/EmailSettings.cs similarity index 53% rename from NzbDrone.Core/Notifications/Smtp/SmtpSettings.cs rename to NzbDrone.Core/Notifications/Email/EmailSettings.cs index 7b172329a..21a58eeea 100644 --- a/NzbDrone.Core/Notifications/Smtp/SmtpSettings.cs +++ b/NzbDrone.Core/Notifications/Email/EmailSettings.cs @@ -1,32 +1,29 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using NzbDrone.Core.Annotations; -namespace NzbDrone.Core.Notifications.Smtp +namespace NzbDrone.Core.Notifications.Email { - public class SmtpSettings : INotifcationSettings + public class EmailSettings : INotifcationSettings { - [FieldDefinition(0, Label = "Server", HelpText = "Hostname or IP of SMTP server")] + [FieldDefinition(0, Label = "Server", HelpText = "Hostname or IP of Email server")] public String Server { get; set; } - [FieldDefinition(1, Label = "Port", HelpText = "SMTP Server Port")] + [FieldDefinition(1, Label = "Port")] public Int32 Port { get; set; } - [FieldDefinition(2, Label = "Use SSL", HelpText = "Does your SMTP server use SSL?")] + [FieldDefinition(2, Label = "Use SSL", HelpText = "Does your Email server use SSL?")] public Boolean UseSsl { get; set; } - [FieldDefinition(3, Label = "Username", HelpText = "SMTP Server Username")] + [FieldDefinition(3, Label = "Username")] public String Username { get; set; } - [FieldDefinition(4, Label = "Password", HelpText = "SMTP Server Password")] + [FieldDefinition(4, Label = "Password")] public String Password { get; set; } - [FieldDefinition(5, Label = "From Address", HelpText = "Sender's address")] + [FieldDefinition(5, Label = "Sender Address")] public String From { get; set; } - [FieldDefinition(6, Label = "To Address", HelpText = "Recipient address")] + [FieldDefinition(6, Label = "Recipient Address")] public String To { get; set; } public bool IsValid diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index f0c08a2ed..6683e5976 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -317,7 +317,7 @@ - + @@ -439,7 +439,7 @@ Code - + Code @@ -489,7 +489,7 @@ Code - + Code