Skip to content

Commit 09b1355

Browse files
Use IUmbracoContextFactory
1 parent 09f7e66 commit 09b1355

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Umbraco.Commerce.Checkout/Views/UmbracoCommerceCheckout/Templates/Email/UmbracoCommerceCheckoutGiftCardEmail.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Lookup the umbraco commerce checkout page for the associated orders store
77
// so that we can extract relevant settings to configure the email template
8-
var ctx = this.GetService<IUmbracoContextAccessor>().GetRequiredUmbracoContext();
8+
var ctx = this.GetService<IUmbracoContextFactory>().EnsureUmbracoContext().UmbracoContext;
99
var checkoutContentType = ctx.Content.GetContentType("uccCheckoutPage");
1010
var checkoutPages = ctx.Content.GetByContentType(checkoutContentType);
1111
var checkoutPage = checkoutPages.First(x => x.GetStore()?.Id == Model.StoreId);

src/Umbraco.Commerce.Checkout/Views/UmbracoCommerceCheckout/Templates/Email/UmbracoCommerceCheckoutOrderConfirmationEmail.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
// Lookup the umbraco commerce checkout page for the associated orders store
2525
// so that we can extract relevant settings to configure the email template
26-
var ctx = this.GetService<IUmbracoContextAccessor>().GetRequiredUmbracoContext();
26+
var ctx = this.GetService<IUmbracoContextFactory>().EnsureUmbracoContext().UmbracoContext;
2727
var checkoutContentType = ctx.Content.GetContentType("uccCheckoutPage");
2828
var checkoutPages = ctx.Content.GetByContentType(checkoutContentType);
2929
var checkoutPage = checkoutPages.First(x => x.GetStore()?.Id == Model.StoreId);

src/Umbraco.Commerce.Checkout/Views/UmbracoCommerceCheckout/Templates/Email/UmbracoCommerceCheckoutOrderErrorEmail.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Lookup the umbraco commerce checkout page for the associated orders store
77
// so that we can extract relevant settings to configure the email template
8-
var ctx = this.GetService<IUmbracoContextAccessor>().GetRequiredUmbracoContext();
8+
var ctx = this.GetService<IUmbracoContextFactory>().EnsureUmbracoContext().UmbracoContext;
99
var checkoutContentType = ctx.Content.GetContentType("uccCheckoutPage");
1010
var checkoutPages = ctx.Content.GetByContentType(checkoutContentType);
1111
var checkoutPage = checkoutPages.First(x => x.GetStore()?.Id == Model.StoreId);

0 commit comments

Comments
 (0)