skoruba / Duende.IdentityServer.Admin

The administration for the Duende IdentityServer and Asp.Net Core Identity ⚡
Apache License 2.0
556 stars 194 forks source link

Configuration of SendGrid IpPoolName #113

Open ghstahl opened 1 year ago

ghstahl commented 1 year ago

Is your feature request related to a problem? Please describe. We setup sendgrid to leverage IpPoolName(s) and it can be set before we send the email.

i.e.


var message = SendGrid.Helpers.Mail.MailHelper.CreateSingleEmail(
     new SendGrid.Helpers.Mail.EmailAddress(_configuration.SourceEmail, _configuration.SourceName),
     new SendGrid.Helpers.Mail.EmailAddress(email),
      subject,
      null,
      htmlMessage
 );
if (_configuration.IpPoolName != null)
{
    message.SetIpPoolName(_configuration.IpPoolName);
}

Describe the solution you'd like Allow IpPoolName to be configurable.

    public class SendGridConfiguration
    {
        public string ApiKey { get; set; }
        public string SourceEmail { get; set; }
        public string SourceName { get; set; }
        public bool EnableClickTracking { get; set; } = false;
        public string? IpPoolName { get; set; }

    }

I think this is the extent of the code change.

skoruba commented 1 year ago

Hi, please, can you send a PR with this change? Thanks