i18n email templates
This commit is contained in:
@@ -5,12 +5,14 @@ from settings import MAILGUN_API_KEY, MAILGUN_DOMAIN
|
||||
api_url = "https://api.mailgun.net/v3/%s/messages" % MAILGUN_DOMAIN
|
||||
noreply = "discours.io <noreply@%s>" % MAILGUN_DOMAIN
|
||||
|
||||
async def send_auth_email(user, token):
|
||||
|
||||
async def send_auth_email(user, token, lang="ru"):
|
||||
try:
|
||||
to = "%s <%s>" % (user.name, user.email)
|
||||
# TODO: i18n
|
||||
subject = "Confirm email"
|
||||
template = "email_confirmation_ru"
|
||||
if lang not in ['ru', 'en']:
|
||||
lang = 'ru'
|
||||
template = "email_confirmation_" + lang
|
||||
|
||||
response = requests.post(
|
||||
api_url,
|
||||
|
Reference in New Issue
Block a user