Change currency in emails.

This commit is contained in:
Lynne 2018-09-19 20:14:39 +02:00
parent ee022f032d
commit 7be17efc8b
3 changed files with 6 additions and 5 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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")