From 3953498b8d5522145ac32ee673e797cc7a8e09ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Wed, 8 Jul 2026 00:13:31 +0300 Subject: [PATCH] =?UTF-8?q?Sales=20Order=20Mail=20Tasar=C4=B1m=C4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Public/PublicAppService.cs | 244 +++++++++++++----- 1 file changed, 180 insertions(+), 64 deletions(-) diff --git a/api/src/Sozsoft.Platform.Application/Public/PublicAppService.cs b/api/src/Sozsoft.Platform.Application/Public/PublicAppService.cs index 948402b..b72979a 100644 --- a/api/src/Sozsoft.Platform.Application/Public/PublicAppService.cs +++ b/api/src/Sozsoft.Platform.Application/Public/PublicAppService.cs @@ -623,83 +623,199 @@ public class PublicAppService : PlatformAppService } } - private static string BuildOrderEmailBody(Order order) + private string BuildOrderEmailBody(Order order) { var itemRows = string.Join(string.Empty, order.Items.Select(item => $@" - {Html(item.ProductName)} - {item.Quantity} - {BillingCycleLabel(item.BillingCycle)} - %{item.VatRate * 100:0.##} / {FormatPrice(item.VatAmount)} - {FormatPrice(item.TotalPrice)} + {Html(Translate(item.ProductName))} + {FormatPrice(item.Price)} + {item.Period} + {item.Quantity} + {BillingCycleLabel(item.BillingCycle)} + %{item.VatRate * 100:0.##} / {FormatPrice(item.VatAmount)} + {FormatPrice(item.TotalPrice)} ")); return $@" - -
-
-
-
-
Sipariş Oluşturuldu
-
Sipariş No: #{order.Id}
-
-
-
Invoice
-
{FormatDate(DateTime.Now)}
-
-
- -
-
-
-
Customer Information
-
- {Html(order.OrganizationName)}
- {Html(order.Email)}
- {Html(FormatPhoneNumber(order.PhoneNumber ?? order.MobileNumber))}
- {Html(order.Address1)}
- {Html(order.District)} / {Html(order.City)} / {Html(order.Country)} -
-
-
-
License Information
-
-
License Start Time: {FormatDate(order.LicenseStartTime)}
-
License End Time: {FormatDate(order.LicenseEndTime)}
-
Billing Cycle: {BillingCycleLabel(order.BillingCycle)}
-
Period: {order.Period}
-
-
-
- - - - - - - - - - - - {itemRows} -
ProductQtyCycleVATAmount
- -
-
Subtotal{FormatPrice(order.Subtotal)}
-
VAT{FormatPrice(order.VatTotal)}
-
Commission{FormatPrice(order.Commission)}
-
Total{FormatPrice(order.Total)}
-
-
-
+ + + + + + +
+ {Html(Translate("Public.order.success.title"))} #{order.Id}
+ + + + +
+ + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + +
+
+ + + + + + + +
{Html(Translate("Public.order.success.title"))}
{Html(Translate("Public.order.success.number"))} #{order.Id}
+
+
+ + + + + + + +
Invoice
{FormatDate(DateTime.Now)}
+
+
+ + + + + +
+ + + + +
+ + + + + + + +
Customer Information
+ {Html(order.OrganizationName)}
+ {Html(order.Email)}
+ {Html(FormatPhoneNumber(order.PhoneNumber ?? order.MobileNumber))}
+ {Html(order.Address1)}
+ {Html(order.Township)} / {Html(order.District)} / {Html(order.City)} / {Html(order.Country)} +
+
+
+ + + + +
+ + + + +
License Information
+ + + + + + + + + + + + + + + + + +
License Start Time{FormatDate(order.LicenseStartTime)}
License End Time{FormatDate(order.LicenseEndTime)}
Billing Cycle{BillingCycleLabel(order.BillingCycle)}
Period{order.Period}
+
+
+ + + + + + + + + + + + + + {itemRows} +
ProductPricePeriodQtyCycleVATAmount
+ + + + + + +
  + + + + + + + + + + + + + + + + + +
{Html(Translate("Public.payment.summary.subtotal"))}{FormatPrice(order.Subtotal)}
{Html(Translate("Public.products.kdv"))}{FormatPrice(order.VatTotal)}
{Html(Translate("Public.payment.installments.commission"))}{FormatPrice(order.Commission)}
{Html(Translate("App.Listform.ListformField.Total"))}{FormatPrice(order.Total)}
+
+
+
"; } + private string Translate(string key) + { + if (key.IsNullOrWhiteSpace()) + { + return string.Empty; + } + + var normalizedKey = key.StartsWith("::", StringComparison.Ordinal) ? key[2..] : key; + var text = L[normalizedKey]; + return text.ResourceNotFound ? key : text.Value; + } + private static string BillingCycleLabel(string billingCycle) { return billingCycle == "monthly" ? "Aylık" : "Yıllık";