From c02a97b3df428637130389b85df392ddfae24171 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Sep 2021 09:28:22 +0200 Subject: [PATCH 1/3] Fixes #11206 IEmailSender not registered in DI container --- src/Umbraco.Core/Composing/Current.cs | 3 +++ src/Umbraco.Web/Composing/Current.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Umbraco.Core/Composing/Current.cs b/src/Umbraco.Core/Composing/Current.cs index a4ccd59f9d09..90faa59cecae 100644 --- a/src/Umbraco.Core/Composing/Current.cs +++ b/src/Umbraco.Core/Composing/Current.cs @@ -222,6 +222,9 @@ public static IVariationContextAccessor VariationContextAccessor public static IImageUrlGenerator ImageUrlGenerator => Factory.GetInstance(); + + public static IEmailSender EmailSender + => Factory.GetInstance(); #endregion } } diff --git a/src/Umbraco.Web/Composing/Current.cs b/src/Umbraco.Web/Composing/Current.cs index 14898d0c02d9..6adb479426a4 100644 --- a/src/Umbraco.Web/Composing/Current.cs +++ b/src/Umbraco.Web/Composing/Current.cs @@ -237,6 +237,8 @@ internal static Type DefaultRenderMvcControllerType public static IVariationContextAccessor VariationContextAccessor => CoreCurrent.VariationContextAccessor; + public static IEmailSender EmailSender => CoreCurrent.EmailSender; + #endregion } } From 1d4c0715bafac3f13ca203cd2ef392ecb4d6bce0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Sep 2021 10:00:01 +0200 Subject: [PATCH 2/3] Fixes #11206 IEmailSender not registered in DI container --- src/Umbraco.Core/Composing/CompositionExtensions/Services.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Core/Composing/CompositionExtensions/Services.cs b/src/Umbraco.Core/Composing/CompositionExtensions/Services.cs index d252c58730ed..d97845928dcb 100644 --- a/src/Umbraco.Core/Composing/CompositionExtensions/Services.cs +++ b/src/Umbraco.Core/Composing/CompositionExtensions/Services.cs @@ -52,6 +52,7 @@ public static Composition ComposeServices(this Composition composition) composition.RegisterUnique(); composition.RegisterUnique(); composition.RegisterUnique(); + composition.RegisterUnique(); composition.Register(SourcesFactory); composition.RegisterUnique(factory => new LocalizedTextService( factory.GetInstance>(), From ccf357aaf52f16f2e7e2768b9923ebf1e41f914c Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Sep 2021 10:01:36 +0200 Subject: [PATCH 3/3] Forgot to revert my previous changes --- src/Umbraco.Core/Composing/Current.cs | 3 --- src/Umbraco.Web/Composing/Current.cs | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/Umbraco.Core/Composing/Current.cs b/src/Umbraco.Core/Composing/Current.cs index 90faa59cecae..a4ccd59f9d09 100644 --- a/src/Umbraco.Core/Composing/Current.cs +++ b/src/Umbraco.Core/Composing/Current.cs @@ -222,9 +222,6 @@ public static IVariationContextAccessor VariationContextAccessor public static IImageUrlGenerator ImageUrlGenerator => Factory.GetInstance(); - - public static IEmailSender EmailSender - => Factory.GetInstance(); #endregion } } diff --git a/src/Umbraco.Web/Composing/Current.cs b/src/Umbraco.Web/Composing/Current.cs index 6adb479426a4..14898d0c02d9 100644 --- a/src/Umbraco.Web/Composing/Current.cs +++ b/src/Umbraco.Web/Composing/Current.cs @@ -237,8 +237,6 @@ internal static Type DefaultRenderMvcControllerType public static IVariationContextAccessor VariationContextAccessor => CoreCurrent.VariationContextAccessor; - public static IEmailSender EmailSender => CoreCurrent.EmailSender; - #endregion } }