DocSas/DSCAppEssentials/Managers/NoficationManager.cs
/// <summary>
/// send email as an asynchronous operation.
/// </summary>
/// <param name="email">The email.</param>
/// <returns>Task.</returns>
send email as an asynchronous operation.
send email as an asynchronous operation .
public static async Task SendEmailAsync(DSCEmail email)
        {
            var apiKey = email.EmailApiKey;
            var client = new SendGridClient(apiKey);
           var fromEmail = new EmailAddress(email.FromEmail.Item1, email.FromEmail.Item2);
            var toEmail = new List<EmailAddress>();
            foreach (var item in email.ToEmail)
            {
                toEmail.Add(new EmailAddress(item));
            }
            var message = MailHelper.CreateSingleEmailToMultipleRecipients(fromEmail, toEmail, email.Subject,email.PlainTextContent,email.HTMLContent);
            await client.SendEmailAsync(message);
        }
public static async Task SendEmailAsync ( DSCEmail email ) { var apiKey = email . EmailApiKey ; var client = new SendGridClient ( apiKey ) ; var fromEmail = new EmailAddress ( email . FromEmail . Item1 , email . FromEmail . Item2 ) ; var toEmail = new List < EmailAddress > ( ) ; foreach ( var item in email . ToEmail ) { toEmail . Add ( new EmailAddress ( item ) ) ; } var message = MailHelper . CreateSingleEmailToMultipleRecipients ( fromEmail , toEmail , email . Subject , email . PlainTextContent , email . HTMLContent ) ; await client . SendEmailAsync ( message ) ; }
send email as an asynchronous operation.
send email as an asynchronous operation .
None
email
DSCEmail
None