src/Fursvp.Communication/SendGridEmailer.cs
/// <summary>
/// Sends an email asynchronously via the SendGrid API.
/// </summary>
/// <param name="email">The email to send.</param>
/// <returns>An object representing the asynchronous task operation.</returns>
Sends an email asynchronously via the SendGrid API.
Sends an email asynchronously via the SendGrid API .
public async Task SendAsync(Email email)
        {
            if (email == null)
            {
                throw new ArgumentNullException(nameof(email));
            }
            try
            {
                var client = new SendGridClient(Options.ApiKey);
                var sendGridMessage = ConvertFrom(email);
                _ = await client.SendEmailAsync(sendGridMessage).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Logger.LogError(ex, "Encountered exception while attempting to send email via SendGrid.", email);
                throw;
            }
        }
public async Task SendAsync ( Email email ) { if ( email == null ) { throw new ArgumentNullException ( nameof ( email ) ) ; } try { var client = new SendGridClient ( Options . ApiKey ) ; var sendGridMessage = ConvertFrom ( email ) ; _ = await client . SendEmailAsync ( sendGridMessage ) . ConfigureAwait ( false ) ; } catch ( Exception ex ) { Logger . LogError ( ex , " " , email ) ; throw ; } }
Sends an email asynchronously via the SendGrid API.
Sends an email asynchronously via the SendGrid API .
An object representing the asynchronous task operation.
An object representing the asynchronous task operation .
email
Email
The email to send.
The email to send .