Change currency in emails.
This commit is contained in:
parent
ee022f032d
commit
7be17efc8b
|
@ -1,5 +1,5 @@
|
|||
An attempt was just made to charge your card for your monthly donation to
|
||||
{{your_name}} for ${{amount}}. Unfortunately, your card was declined.
|
||||
{{your_name}} for {{amount}}. Unfortunately, your card was declined.
|
||||
|
||||
The donation has been disabled. If you would like to, you may create a new
|
||||
recurring donation here:
|
||||
|
|
|
@ -3,10 +3,10 @@ Thank you for donating!
|
|||
Receipt:
|
||||
|
||||
{{#monthly}}
|
||||
Monthly donation ${{amount}}
|
||||
Monthly donation {{amount}}
|
||||
{{/monthly}}
|
||||
{{^monthly}}
|
||||
One-time donation ${{amount}}
|
||||
One-time donation {{amount}}
|
||||
{{/monthly}}
|
||||
|
||||
You can view and manage your donations online here:
|
||||
|
|
|
@ -10,6 +10,7 @@ from flask import url_for
|
|||
from fosspay.database import db
|
||||
from fosspay.objects import User
|
||||
from fosspay.config import _cfg, _cfgi
|
||||
from fosspay.currency import currency
|
||||
|
||||
def send_thank_you(user, amount, monthly):
|
||||
if _cfg("smtp-host") == "":
|
||||
|
@ -24,7 +25,7 @@ def send_thank_you(user, amount, monthly):
|
|||
"user": user,
|
||||
"root": _cfg("protocol") + "://" + _cfg("domain"),
|
||||
"your_name": _cfg("your-name"),
|
||||
"amount": "{:.2f}".format(amount / 100),
|
||||
"amount": currency.amount("{:.2f}".format(amount / 100)),
|
||||
"monthly": monthly,
|
||||
"your_email": _cfg("your-email")
|
||||
})))
|
||||
|
@ -70,7 +71,7 @@ def send_declined(user, amount):
|
|||
"user": user,
|
||||
"root": _cfg("protocol") + "://" + _cfg("domain"),
|
||||
"your_name": _cfg("your-name"),
|
||||
"amount": "{:.2f}".format(amount / 100)
|
||||
"amount": currency.amount("{:.2f}".format(amount / 100))
|
||||
})))
|
||||
message['Subject'] = "Your monthly donation was declined."
|
||||
message['From'] = _cfg("smtp-from")
|
||||
|
|
Loading…
Reference in New Issue