Use configured currency symbol in email templates #59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/sub-pr-58"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Email templates for high cost alerts and renewal reminders used hard-coded
$symbols instead of respecting the user's configured currency setting.Changes
SendHighCostAlert()andSendRenewalReminder()to retrieve currency symbol viaGetCurrencySymbol(){{.CurrencySymbol}}instead of hard-coded$Example
Email notifications now display the correct currency symbol for users with non-USD currency preferences.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.
Pull Request Overview
This PR updates email notification templates to use dynamic currency symbols instead of hard-coded dollar signs. The changes ensure that high-cost alerts and renewal reminder emails display the user's configured currency symbol.
github.com/dromara/carbon/v2from indirect to direct dependencyReviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
github.com/dromara/carbon/v2from indirect to direct dependency and removed unusedgithub.com/stretchr/objxindirect dependencygithub.com/stretchr/objx v0.5.2entries💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -193,12 +196,12 @@ func (e *EmailService) SendHighCostAlert(subscription *models.Subscription) erro</div>MonthlyCost is a method, not a field. The template should call it as a method:
{{.Subscription.MonthlyCost}}without theprintfsinceMonthlyCost()already returns a float64. The current code will fail at runtime because Go templates cannot call methods withprintfdirectly on method return values in this way.@ -251,16 +267,16 @@ func (e *EmailService) SendRenewalReminder(subscription *models.Subscription, da<div class="container">MonthlyCost is a method, not a field. The template should call it as a method:
{{.Subscription.MonthlyCost}}without theprintfsinceMonthlyCost()already returns a float64. The current code will fail at runtime because Go templates cannot call methods withprintfdirectly on method return values in this way.