diff --git a/DysonNetwork.Pass/Account/AccountService.cs b/DysonNetwork.Pass/Account/AccountService.cs index 9d344fd2..dd49e444 100644 --- a/DysonNetwork.Pass/Account/AccountService.cs +++ b/DysonNetwork.Pass/Account/AccountService.cs @@ -466,12 +466,12 @@ public class AccountService( contact.Content, localizer.Get("codeEmailTitle", account.Language), "FactorCode", - account.Language, new VerificationEmailModel { Name = account.Name, Code = code - } + }, + account.Language ); await _SetFactorCode(factor, code, TimeSpan.FromMinutes(30)); diff --git a/DysonNetwork.Pass/Account/MagicSpellService.cs b/DysonNetwork.Pass/Account/MagicSpellService.cs index cd122f26..edaa70f9 100644 --- a/DysonNetwork.Pass/Account/MagicSpellService.cs +++ b/DysonNetwork.Pass/Account/MagicSpellService.cs @@ -99,12 +99,12 @@ public class MagicSpellService( contact.Content, localizer.Get("regConfirmTitle", accountLanguage), "Welcome", - accountLanguage, new LandingEmailModel { Name = contact.Account.Name, Link = link - } + }, + accountLanguage ); break; case MagicSpellType.AccountRemoval: @@ -113,12 +113,12 @@ public class MagicSpellService( contact.Content, localizer.Get("accountDeletionTitle", accountLanguage), "AccountDeletion", - accountLanguage, new AccountDeletionEmailModel { Name = contact.Account.Name, Link = link - } + }, + accountLanguage ); break; case MagicSpellType.AuthPasswordReset: @@ -127,12 +127,12 @@ public class MagicSpellService( contact.Content, localizer.Get("passwordResetTitle", accountLanguage), "PasswordReset", - accountLanguage, new PasswordResetEmailModel { Name = contact.Account.Name, Link = link - } + }, + accountLanguage ); break; case MagicSpellType.ContactVerification: @@ -143,12 +143,12 @@ public class MagicSpellService( contactMethod!, localizer.Get("contractMethodVerificationTitle", accountLanguage), "ContactVerification", - accountLanguage, new ContactVerificationEmailModel { Name = contact.Account.Name, Link = link - } + }, + accountLanguage ); break; case MagicSpellType.AccountDeactivation: diff --git a/DysonNetwork.Pass/Account/RelationshipService.cs b/DysonNetwork.Pass/Account/RelationshipService.cs index 2f10582c..91dc8377 100644 --- a/DysonNetwork.Pass/Account/RelationshipService.cs +++ b/DysonNetwork.Pass/Account/RelationshipService.cs @@ -117,7 +117,7 @@ public class RelationshipService( Notification = new PushNotification { Topic = "relationships.friends.request", - Title = localizer.Get("friendRequestTitle", locale: sender.Language, args: new { sender.Nick }), + Title = localizer.Get("friendRequestTitle", locale: sender.Language, args: new { sender = sender.Nick }), Body = localizer.Get("friendRequestBody", locale: sender.Language), ActionUri = "/account/relationships", IsSavable = true diff --git a/DysonNetwork.Pass/Realm/RealmServiceGrpc.cs b/DysonNetwork.Pass/Realm/RealmServiceGrpc.cs index 60e87316..8ec2ea57 100644 --- a/DysonNetwork.Pass/Realm/RealmServiceGrpc.cs +++ b/DysonNetwork.Pass/Realm/RealmServiceGrpc.cs @@ -128,7 +128,7 @@ public class RealmServiceGrpc( { Topic = "invites.realms", Title = localizer.Get("realmInviteTitle", account.Language), - Body = localizer.Get("realmInviteBody", locale: account.Language, args: new { realmName = member?.Name ?? "Unknown Realm" }), + Body = localizer.Get("realmInviteBody", locale: account.Language, args: new { realmName = member?.Realm?.Name ?? "Unknown Realm" }), ActionUri = "/realms", IsSavable = true } diff --git a/DysonNetwork.Sphere/Post/PostService.cs b/DysonNetwork.Sphere/Post/PostService.cs index 54a79dfa..68ccbe0c 100644 --- a/DysonNetwork.Sphere/Post/PostService.cs +++ b/DysonNetwork.Sphere/Post/PostService.cs @@ -230,7 +230,7 @@ public partial class PostService( Notification = new PushNotification { Topic = "post.replies", - Title = localizer.Get("postReplyTitle", args: new { senderNick = sender!.Nick }), + Title = localizer.Get("postReplyTitle", args: new { user = sender!.Nick }), Body = ChopPostForNotification(post).content, IsSavable = true, ActionUri = $"/posts/{post.Id}" @@ -704,10 +704,10 @@ public partial class PostService( Notification = new PushNotification { Topic = "posts.reactions.new", - Title = localizer.Get("postReactTitle", args: new { senderNick = sender.Nick }), + Title = localizer.Get("postReactTitle", args: new { user = sender.Nick }), Body = string.IsNullOrWhiteSpace(post.Title) - ? localizer.Get("postReactBody", args: new { senderNick = sender.Nick, reaction.Symbol }) - : localizer.Get("postReactContentBody", args: new { senderNick = sender.Nick, reaction.Symbol, post.Title }), + ? localizer.Get("postReactBody", args: new { user = sender.Nick, reaction = reaction.Symbol }) + : localizer.Get("postReactContentBody", args: new { user = sender.Nick, reaction = reaction.Symbol, title = post.Title }), IsSavable = true, ActionUri = $"/posts/{post.Id}" } @@ -1157,10 +1157,10 @@ public partial class PostService( Notification = new PushNotification { Topic = "posts.awards.new", - Title = localizer.Get("postAwardedTitle", args: new { senderNick = sender.Nick }), + Title = localizer.Get("postAwardedTitle", args: new { user = sender.Nick }), Body = string.IsNullOrWhiteSpace(post.Title) - ? localizer.Get("postAwardedBody", args: new { senderNick = sender.Nick, amount }) - : localizer.Get("postAwardedContentBody", args: new { senderNick = sender.Nick, amount, post.Title }), + ? localizer.Get("postAwardedBody", args: new { user = sender.Nick, amount }) + : localizer.Get("postAwardedContentBody", args: new { user = sender.Nick, amount, title = post.Title }), IsSavable = true, ActionUri = $"/posts/{post.Id}" } diff --git a/DysonNetwork.Sphere/Publisher/PublisherSubscriptionService.cs b/DysonNetwork.Sphere/Publisher/PublisherSubscriptionService.cs index 123a18e9..50851005 100644 --- a/DysonNetwork.Sphere/Publisher/PublisherSubscriptionService.cs +++ b/DysonNetwork.Sphere/Publisher/PublisherSubscriptionService.cs @@ -118,7 +118,7 @@ public class PublisherSubscriptionService( var notification = new PushNotification { Topic = "posts.new", - Title = localizer.Get("postSubscriptionTitle", args: new { publisherNick = post.Publisher!.Nick, title }), + Title = localizer.Get("postSubscriptionTitle", args: new { publisher = post.Publisher!.Nick, title }), Body = message, Meta = GrpcTypeHelper.ConvertObjectToByteString(data), IsSavable = true, diff --git a/DysonNetwork.Sphere/Resources/Locales/en.json b/DysonNetwork.Sphere/Resources/Locales/en.json index bbdbe93e..d7af0d33 100644 --- a/DysonNetwork.Sphere/Resources/Locales/en.json +++ b/DysonNetwork.Sphere/Resources/Locales/en.json @@ -20,5 +20,5 @@ "subscriptionAppliedTitle": "Subscription {plan} just activated for your account", "subscriptionAppliedBody": "Thank for supporting the Solar Network! Your {days} days {plan} subscription just begun, feel free to explore the newly unlocked features!", "orderPaidTitle": "Order {orderId} recipient", - "orderPaidBody": "{amount} {currency} was removed from your wallet to pay for {item}" + "orderPaidBody": "{amount} {currency} was removed from your wallet to pay for {remark}" } diff --git a/DysonNetwork.Sphere/Resources/Locales/zh-hans.json b/DysonNetwork.Sphere/Resources/Locales/zh-hans.json index 075a4381..af26e43e 100644 --- a/DysonNetwork.Sphere/Resources/Locales/zh-hans.json +++ b/DysonNetwork.Sphere/Resources/Locales/zh-hans.json @@ -20,5 +20,5 @@ "subscriptionAppliedTitle": "订阅 {plan} 刚刚为您的账户激活", "subscriptionAppliedBody": "感谢您支持 Solar Network!您的 {days} 天 {plan} 订阅刚刚开始,请尽情探索新解锁的功能!", "orderPaidTitle": "订单 {orderId} 收件人", - "orderPaidBody": "{amount} {currency} 已从您的钱包中扣除以支付 {item}" + "orderPaidBody": "{amount} {currency} 已从您的钱包中扣除以支付 {remark}" } diff --git a/DysonNetwork.Wallet/Payment/SubscriptionService.cs b/DysonNetwork.Wallet/Payment/SubscriptionService.cs index 4e71c1c1..7e0f53c8 100644 --- a/DysonNetwork.Wallet/Payment/SubscriptionService.cs +++ b/DysonNetwork.Wallet/Payment/SubscriptionService.cs @@ -425,7 +425,7 @@ public class SubscriptionService( { Topic = "subscriptions.begun", Title = localizer.Get("subscriptionAppliedTitle", locale: locale, args: new { subscriptionName = humanReadableName }), - Body = localizer.Get("subscriptionAppliedBody", locale: locale, args: new { duration, subscriptionName = humanReadableName }), + Body = localizer.Get("subscriptionAppliedBody", locale: locale, args: new { duration, subscription = humanReadableName }), Meta = GrpcTypeHelper.ConvertObjectToByteString(new Dictionary { ["subscription_id"] = subscription.Id.ToString() @@ -923,7 +923,7 @@ public class SubscriptionService( { Topic = "gifts.claimed", Title = localizer.Get("giftClaimedTitle", locale: locale), - Body = localizer.Get("giftClaimedBody", locale: locale, args: new { subscriptionName = humanReadableName, redeemerName = redeemer.Name }), + Body = localizer.Get("giftClaimedBody", locale: locale, args: new { subscription = humanReadableName, user = redeemer.Name }), Meta = GrpcTypeHelper.ConvertObjectToByteString(new Dictionary { ["gift_id"] = gift.Id.ToString(),