Exemple #1
0
 public DonorController(IWebHostEnvironment env, IOptions <AppSettings> appSettings, IOptions <MAwsEmail> MAwsEmail, IOptions <MAwsS3> MAwsS3)
 {
     _env         = env;
     _appSettings = appSettings;
     _MAwsEmail   = MAwsEmail.Value;
     _MAwsS3      = MAwsS3.Value;
 }
Exemple #2
0
        public static async void SendEmailAsync(MAwsEmail mAwsEmail)
        {
            try
            {
                using (var clients = new AmazonSimpleEmailServiceClient(UEncrypt.Decrypt(mAwsEmail.AccessKey), UEncrypt.Decrypt(mAwsEmail.SecretKey), RegionEndpoint.USWest2))
                {
                    var sendRequest = new SendEmailRequest
                    {
                        Source      = mAwsEmail.VerifiedFromEmail,
                        Destination = new Destination
                        {
                            ToAddresses = new List <string> {
                                mAwsEmail.ToEmail
                            }
                        },
                        Message = new Message
                        {
                            Subject = new Content(mAwsEmail.Subject),
                            Body    = new Body
                            {
                                Html = new Content(mAwsEmail.Message)
                            }
                        },
                    };

                    try
                    {
                        var response = await clients.SendEmailAsync(sendRequest);
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Exemple #3
0
 public ProfileController(IOptions <AppSettings> appSettings, IOptions <MAwsEmail> MAwsEmail, IOptions <MAwsS3> MAwsS3)
 {
     _appSettings = appSettings;
     _MAwsEmail   = MAwsEmail.Value;
     _MAwsS3      = MAwsS3.Value;
 }