1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-18 01:53:49 -05:00

Added SendGridApiHost to Globals (#5961)

* Added SendGridApiHost to Globals

* Added SendGridApiHost for test coverage
This commit is contained in:
Alexey Zilber 2025-06-17 21:35:38 +08:00 committed by GitHub
parent a529492d1d
commit 17507446a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,7 @@ public class SendGridMailDeliveryService : IMailDeliveryService, IDisposable
GlobalSettings globalSettings, GlobalSettings globalSettings,
IWebHostEnvironment hostingEnvironment, IWebHostEnvironment hostingEnvironment,
ILogger<SendGridMailDeliveryService> logger) ILogger<SendGridMailDeliveryService> logger)
: this(new SendGridClient(globalSettings.Mail.SendGridApiKey), : this(new SendGridClient(globalSettings.Mail.SendGridApiKey, globalSettings.Mail.SendGridApiHost),
globalSettings, hostingEnvironment, logger) globalSettings, hostingEnvironment, logger)
{ {
} }

View File

@ -431,6 +431,7 @@ public class GlobalSettings : IGlobalSettings
public SmtpSettings Smtp { get; set; } = new SmtpSettings(); public SmtpSettings Smtp { get; set; } = new SmtpSettings();
public string SendGridApiKey { get; set; } public string SendGridApiKey { get; set; }
public int? SendGridPercentage { get; set; } public int? SendGridPercentage { get; set; }
public string SendGridApiHost { get; set; } = "https://api.sendgrid.com";
public class SmtpSettings public class SmtpSettings
{ {

View File

@ -25,7 +25,8 @@ public class SendGridMailDeliveryServiceTests : IDisposable
{ {
Mail = Mail =
{ {
SendGridApiKey = "SendGridApiKey" SendGridApiKey = "SendGridApiKey",
SendGridApiHost = "https://api.sendgrid.com"
} }
}; };