1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

add support for postal and multi service mail delivery (#1326)

* adds suppose for postal and multi service mail delivery

* adjust tags

* dont need settings checks in multi-service
This commit is contained in:
Kyle Spearrin
2021-05-13 15:18:42 -04:00
committed by GitHub
parent 571862a7ac
commit b150f5977e
4 changed files with 173 additions and 2 deletions

View File

@ -143,7 +143,13 @@ namespace Bit.Core.Utilities
services.AddSingleton<IApplicationCacheService, InMemoryApplicationCacheService>();
}
if (CoreHelpers.SettingHasValue(globalSettings.Amazon?.AccessKeySecret))
var awsConfigured = CoreHelpers.SettingHasValue(globalSettings.Amazon?.AccessKeySecret);
if (!globalSettings.SelfHosted && awsConfigured &&
CoreHelpers.SettingHasValue(globalSettings.Mail?.PostalApiKey))
{
services.AddSingleton<IMailDeliveryService, MultiServiceMailDeliveryService>();
}
else if (awsConfigured)
{
services.AddSingleton<IMailDeliveryService, AmazonSesMailDeliveryService>();
}
@ -505,7 +511,7 @@ namespace Bit.Core.Utilities
{
mvc.Services.AddTransient<IViewLocalizer, I18nViewLocalizer>();
return mvc.AddViewLocalization(options => options.ResourcesPath = "Resources")
.AddDataAnnotationsLocalization(options =>
.AddDataAnnotationsLocalization(options =>
options.DataAnnotationLocalizerProvider = (type, factory) =>
{
var assemblyName = new AssemblyName(typeof(SharedResources).GetTypeInfo().Assembly.FullName);