Skip to content

Commit 756ad81

Browse files
author
Claude
committed
Update email templates
1 parent 3f4ca10 commit 756ad81

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@
1414
}
1515

1616
var uccStoreLogoUrl = checkoutPage.Value<IPublishedContent>("uccStoreLogo")?.Url();
17+
1718
if (string.IsNullOrWhiteSpace(uccStoreLogoUrl))
1819
{
20+
// Fallback to the store logo if the checkout page logo is not set
1921
uccStoreLogoUrl = store.LogoImageUrl;
2022
}
2123

24+
if (!string.IsNullOrWhiteSpace(uccStoreLogoUrl) && !uccStoreLogoUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
25+
{
26+
// Ensure the logo URL is absolute
27+
uccStoreLogoUrl = BaseUrl + uccStoreLogoUrl;
28+
}
29+
2230
var uccStoreTsAndCsUrl = checkoutPage.Value<IPublishedContent>("uccTermsAndConditionsPage")?.Url();
2331
var uccStorePrivacyPolicyUrl = checkoutPage.Value<IPublishedContent>("uccPrivacyPolicyPage")?.Url();
2432

@@ -33,7 +41,13 @@
3341
}
3442
}
3543

36-
var uccThemeColor = checkoutPage.Value<string>("uccThemeColor", defaultValue: store.ThemeColor ?? "#000000");
44+
var uccThemeColor = checkoutPage.Value<string>("uccThemeColor");
45+
46+
if (string.IsNullOrWhiteSpace(uccThemeColor))
47+
{
48+
// Fallback to the store theme color if the checkout page theme color is not set
49+
uccThemeColor = store.ThemeColor ?? "#000000";
50+
}
3751
}
3852
<style>
3953
#ucc, #ucc td, #ucc p {
@@ -58,11 +72,11 @@
5872

5973
@if (!string.IsNullOrWhiteSpace(uccStoreLogoUrl))
6074
{
61-
<a href="@(BaseUrl)" target="_blank"><img src="@Html.Raw(BaseUrl + uccStoreLogoUrl.GetCropUrl(200, 100, imageCropMode: ImageCropMode.Max))" alt="@(store.Name)" border="0" /></a>
75+
<a href="@(BaseUrl)" target="_blank"><img src="@Html.Raw(uccStoreLogoUrl.GetCropUrl(200, 100, imageCropMode: ImageCropMode.Max))" alt="@(store.Name)" border="0" /></a>
6276
}
6377
else
6478
{
65-
<h1 class="margin: 0 0 20px; font-size: 30px; line-height: 38px; color: ##000;"><a href="@(BaseUrl)" style="color: #000;" target="_blank">@(store.Name)</a></h1>
79+
<h1 class="margin: 0 0 20px; font-size: 30px; line-height: 38px; color: #000;"><a href="@(BaseUrl)" style="color: #000;" target="_blank">@(store.Name)</a></h1>
6680
}
6781

6882
<hr style="border: 0; height: 1px; background: #ebebe9; margin: 20px 0;" />

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@
3232
}
3333

3434
var uccStoreLogoUrl = checkoutPage.Value<IPublishedContent>("uccStoreLogo")?.Url();
35+
3536
if (string.IsNullOrWhiteSpace(uccStoreLogoUrl))
3637
{
38+
// Fallback to the store logo if the checkout page logo is not set
3739
uccStoreLogoUrl = store.LogoImageUrl;
3840
}
3941

42+
if (!string.IsNullOrWhiteSpace(uccStoreLogoUrl) && !uccStoreLogoUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
43+
{
44+
// Ensure the logo URL is absolute
45+
uccStoreLogoUrl = BaseUrl + uccStoreLogoUrl;
46+
}
47+
4048
var uccStoreTsAndCsUrl = checkoutPage.Value<IPublishedContent>("uccTermsAndConditionsPage")?.Url();
4149
var uccStorePrivacyPolicyUrl = checkoutPage.Value<IPublishedContent>("uccPrivacyPolicyPage")?.Url();
4250

@@ -51,7 +59,13 @@
5159
}
5260
}
5361

54-
var uccThemeColor = checkoutPage.Value<string>("uccThemeColor", defaultValue: store.ThemeColor ?? "#000000");
62+
var uccThemeColor = checkoutPage.Value<string>("uccThemeColor");
63+
64+
if (string.IsNullOrWhiteSpace(uccThemeColor))
65+
{
66+
// Fallback to the store theme color if the checkout page theme color is not set
67+
uccThemeColor = store.ThemeColor ?? "#000000";
68+
}
5569
}
5670
<style type="text/css">
5771
#ucc, #ucc td, #ucc p {
@@ -77,11 +91,11 @@
7791

7892
@if (!string.IsNullOrWhiteSpace(uccStoreLogoUrl))
7993
{
80-
<a href="@(BaseUrl)" target="_blank"><img src="@Html.Raw(BaseUrl + uccStoreLogoUrl.GetCropUrl(200, 100, imageCropMode: ImageCropMode.Max))" alt="@(store.Name)" border="0" /></a>
94+
<a href="@(BaseUrl)" target="_blank"><img src="@Html.Raw(uccStoreLogoUrl.GetCropUrl(200, 100, imageCropMode: ImageCropMode.Max))" alt="@(store.Name)" border="0" /></a>
8195
}
8296
else
8397
{
84-
<h1 class="margin: 0 0 20px; font-size: 30px; line-height: 38px; color: ##000;"><a href="@(BaseUrl)" style="color: #000;" target="_blank">@(store.Name)</a></h1>
98+
<h1 class="margin: 0 0 20px; font-size: 30px; line-height: 38px; color: #000;"><a href="@(BaseUrl)" style="color: #000;" target="_blank">@(store.Name)</a></h1>
8599
}
86100

87101
<hr style="border: 0; height: 1px; background: #ebebe9; margin: 20px 0;" />

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@
1414
}
1515

1616
var uccStoreLogoUrl = checkoutPage.Value<IPublishedContent>("uccStoreLogo")?.Url();
17+
1718
if (string.IsNullOrWhiteSpace(uccStoreLogoUrl))
1819
{
20+
// Fallback to the store logo if the checkout page logo is not set
1921
uccStoreLogoUrl = store.LogoImageUrl;
2022
}
2123

24+
if (!string.IsNullOrWhiteSpace(uccStoreLogoUrl) && !uccStoreLogoUrl.StartsWith("http", StringComparison.OrdinalIgnoreCase))
25+
{
26+
// Ensure the logo URL is absolute
27+
uccStoreLogoUrl = BaseUrl + uccStoreLogoUrl;
28+
}
29+
2230
var uccStoreTsAndCsUrl = checkoutPage.Value<IPublishedContent>("uccTermsAndConditionsPage")?.Url();
2331
var uccStorePrivacyPolicyUrl = checkoutPage.Value<IPublishedContent>("uccPrivacyPolicyPage")?.Url();
2432

@@ -33,7 +41,13 @@
3341
}
3442
}
3543

36-
var uccThemeColor = checkoutPage.Value<string>("uccThemeColor", defaultValue: store.ThemeColor ?? "#000000");
44+
var uccThemeColor = checkoutPage.Value<string>("uccThemeColor");
45+
46+
if (string.IsNullOrWhiteSpace(uccThemeColor))
47+
{
48+
// Fallback to the store theme color if the checkout page theme color is not set
49+
uccThemeColor = store.ThemeColor ?? "#000000";
50+
}
3751
}
3852
<style type="text/css">
3953
#ucc, #ucc td, #ucc p {
@@ -58,11 +72,11 @@
5872

5973
@if (!string.IsNullOrWhiteSpace(uccStoreLogoUrl))
6074
{
61-
<a href="@(BaseUrl)" target="_blank"><img src="@Html.Raw(BaseUrl + uccStoreLogoUrl.GetCropUrl(200, 100, imageCropMode: ImageCropMode.Max))" alt="@(store.Name)" border="0" /></a>
75+
<a href="@(BaseUrl)" target="_blank"><img src="@Html.Raw(uccStoreLogoUrl.GetCropUrl(200, 100, imageCropMode: ImageCropMode.Max))" alt="@(store.Name)" border="0" /></a>
6276
}
6377
else
6478
{
65-
<h1 class="margin: 0 0 20px; font-size: 30px; line-height: 38px; color: ##000;"><a href="@(BaseUrl)" style="color: #000;" target="_blank">@(store.Name)</a></h1>
79+
<h1 class="margin: 0 0 20px; font-size: 30px; line-height: 38px; color: #000;"><a href="@(BaseUrl)" style="color: #000;" target="_blank">@(store.Name)</a></h1>
6680
}
6781

6882
<hr style="border: 0; height: 1px; background: #ebebe9; margin: 20px 0;" />

0 commit comments

Comments
 (0)