@ -16,13 +16,13 @@ namespace NzbDrone.Core.Notifications.Email
RuleFor ( c = > c . Port ) . InclusiveBetween ( 1 , 65535 ) ;
RuleFor ( c = > c . From ) . NotEmpty ( ) ;
RuleForEach ( c = > c . To ) . EmailAddress ( ) ;
RuleForEach ( c = > c . C C ) . EmailAddress ( ) ;
RuleForEach ( c = > c . C c ) . EmailAddress ( ) ;
RuleForEach ( c = > c . Bcc ) . EmailAddress ( ) ;
// Only require one of three send fields to be set
RuleFor ( c = > c . To ) . NotEmpty ( ) . Unless ( c = > c . Bcc . Any ( ) | | c . C C . Any ( ) ) ;
RuleFor ( c = > c . C C ) . NotEmpty ( ) . Unless ( c = > c . To . Any ( ) | | c . Bcc . Any ( ) ) ;
RuleFor ( c = > c . Bcc ) . NotEmpty ( ) . Unless ( c = > c . To . Any ( ) | | c . C C . Any ( ) ) ;
RuleFor ( c = > c . To ) . NotEmpty ( ) . Unless ( c = > c . Bcc . Any ( ) | | c . C c . Any ( ) ) ;
RuleFor ( c = > c . C c ) . NotEmpty ( ) . Unless ( c = > c . To . Any ( ) | | c . Bcc . Any ( ) ) ;
RuleFor ( c = > c . Bcc ) . NotEmpty ( ) . Unless ( c = > c . To . Any ( ) | | c . C c . Any ( ) ) ;
}
}
@ -34,7 +34,7 @@ namespace NzbDrone.Core.Notifications.Email
{
Port = 567 ;
To = Array . Empty < string > ( ) ;
C C = Array . Empty < string > ( ) ;
C c = Array . Empty < string > ( ) ;
Bcc = Array . Empty < string > ( ) ;
}
@ -60,7 +60,7 @@ namespace NzbDrone.Core.Notifications.Email
public IEnumerable < string > To { get ; set ; }
[FieldDefinition(7, Label = "CC Address(es)", HelpText = "Comma separated list of email cc recipients", Placeholder = "example@email.com,example1@email.com", Advanced = true)]
public IEnumerable < string > C C { get ; set ; }
public IEnumerable < string > C c { get ; set ; }
[FieldDefinition(8, Label = "BCC Address(es)", HelpText = "Comma separated list of email bcc recipients", Placeholder = "example@email.com,example1@email.com", Advanced = true)]
public IEnumerable < string > Bcc { get ; set ; }