private static IMailSender CreateMailSender(SendingStrategy sendingStrategy)
 {
     switch (sendingStrategy)
     {
         case SendingStrategy.AmazonSesApiRaw:
             return new AmazonSesApiRawMailSender();
         case SendingStrategy.AmazonSesApi:
             return new AmazonSesApiMailSender();
         case SendingStrategy.AmazonSesApiRawNoSdk:
             return new AmazonSesApiRawMailSenderNoSdk();
         case SendingStrategy.Smtp:
             return new SmtpMailSender();
         case SendingStrategy.SendGridApi:
             return new SendGridApiMailSender();
         default:
             throw new InvalidEnumArgumentException(
                 nameof(sendingStrategy), (int)sendingStrategy, typeof(SendingStrategy));
     }
 }
Beispiel #2
0
        private static IMailSender CreateMailSender(SendingStrategy sendingStrategy)
        {
            switch (sendingStrategy)
            {
            case SendingStrategy.AmazonSesApiRaw:
                return(new AmazonSesApiRawMailSender());

            case SendingStrategy.AmazonSesApi:
                return(new AmazonSesApiMailSender());

            case SendingStrategy.AmazonSesApiRawNoSdk:
                return(new AmazonSesApiRawMailSenderNoSdk());

            case SendingStrategy.Smtp:
                return(new SmtpMailSender());

            case SendingStrategy.SendGridApi:
                return(new SendGridApiMailSender());

            default:
                throw new InvalidEnumArgumentException(
                          nameof(sendingStrategy), (int)sendingStrategy, typeof(SendingStrategy));
            }
        }