API - send an email when data export is successful

This commit is contained in:
Sam
2023-03-04 10:49:25 +01:00
parent 32f358b8cb
commit 06d4a53fbb
26 changed files with 627 additions and 25 deletions

View File

@ -51,3 +51,13 @@ def account_confirmation_email(user: Dict, email_data: Dict) -> None:
recipient=user['email'],
data=email_data,
)
@dramatiq.actor(queue_name='fittrackee_emails')
def data_export_email(user: Dict, email_data: Dict) -> None:
email_service.send(
template='data_export_ready',
lang=user['language'],
recipient=user['email'],
data=email_data,
)

View File

@ -0,0 +1,26 @@
{% extends "layout.html" %}
{% block title %}{{ _('Your archive is ready to be downloaded') }}{% endblock %}
{% block preheader %}{{ _('A download link is available in your account.') }}{% endblock %}
{% block content %}<p>{{ _('You have requested an export of your account on FitTrackee.') }} {{ _('The archive is now ready to be downloaded from your account.') }}</p>
<table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
<tr>
<td align="center">
<a href="{{account_url}}" class="f-fallback button button--green" target="_blank">{{ _('Download your archive') }}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>{% endblock %}
{% block not_initiated %}{{ _("If you did not request the export, please change your password immediately or contact your administrator if your account is locked.") }}{% endblock %}
{% block url_to_paste %}<table class="body-sub" role="presentation">
<tr>
<td>
<p class="f-fallback sub">{{ _("If you're having trouble with the button above, copy and paste the URL below into your web browser.") }}</p>
<p class="f-fallback sub">{{account_url}}</p>
</td>
</tr>
</table>{% endblock %}

View File

@ -0,0 +1,5 @@
{% extends "layout.txt" %}{% block content %}{{ _('You have requested an export of your account on FitTrackee.') }}
{{ _('The archive is now ready to be downloaded from your account.') }}
{{ _('Download your archive') }}: {{ account_url }}
{{ _('If you did not request the export, please change your password immediately or contact your administrator if your account is locked.') }}{% endblock %}

View File

@ -0,0 +1 @@
FitTrackee - {{ _('Your archive is ready to be downloaded') }}

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-03 07:58+0200\n"
"POT-Creation-Date: 2023-03-04 10:33+0100\n"
"PO-Revision-Date: 2022-07-04 21:17+0000\n"
"Last-Translator: J. Lavoie <j.lavoie@net-c.ca>\n"
"Language: de\n"
@ -84,6 +84,7 @@ msgstr ""
"E-Mail bitte."
#: fittrackee/emails/templates/account_confirmation/body.html:22
#: fittrackee/emails/templates/data_export_ready/body.html:22
#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
#: fittrackee/emails/templates/password_reset_request/body.html:24
msgid ""
@ -97,6 +98,37 @@ msgstr ""
msgid "Use the link below to confirm your address email."
msgstr "Verwende den unteren Link, um deine E-Mail-Adresse zu bestätigen."
#: fittrackee/emails/templates/data_export_ready/body.html:2
#: fittrackee/emails/templates/data_export_ready/subject.txt:1
msgid "Your archive is ready to be downloaded"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:3
msgid "A download link is available in your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:1
msgid "You have requested an export of your account on FitTrackee."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:2
msgid "The archive is now ready to be downloaded from your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:11
#: fittrackee/emails/templates/data_export_ready/body.txt:4
msgid "Download your archive"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:18
#: fittrackee/emails/templates/data_export_ready/body.txt:5
msgid ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
msgstr ""
#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
msgid "Email changed"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-03 07:58+0200\n"
"POT-Creation-Date: 2023-03-04 10:33+0100\n"
"PO-Revision-Date: 2022-07-02 18:25+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
@ -83,6 +83,7 @@ msgstr ""
"email."
#: fittrackee/emails/templates/account_confirmation/body.html:22
#: fittrackee/emails/templates/data_export_ready/body.html:22
#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
#: fittrackee/emails/templates/password_reset_request/body.html:24
msgid ""
@ -96,6 +97,39 @@ msgstr ""
msgid "Use the link below to confirm your address email."
msgstr "Use the link below to confirm your address email."
#: fittrackee/emails/templates/data_export_ready/body.html:2
#: fittrackee/emails/templates/data_export_ready/subject.txt:1
msgid "Your archive is ready to be downloaded"
msgstr "Your archive is ready to be downloaded"
#: fittrackee/emails/templates/data_export_ready/body.html:3
msgid "A download link is available in your account."
msgstr "A download link is available in your account."
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:1
msgid "You have requested an export of your account on FitTrackee."
msgstr "You have requested an export of your account on FitTrackee."
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:2
msgid "The archive is now ready to be downloaded from your account."
msgstr "The archive is now ready to be downloaded from your account."
#: fittrackee/emails/templates/data_export_ready/body.html:11
#: fittrackee/emails/templates/data_export_ready/body.txt:4
msgid "Download your archive"
msgstr "Download your archive"
#: fittrackee/emails/templates/data_export_ready/body.html:18
#: fittrackee/emails/templates/data_export_ready/body.txt:5
msgid ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
msgstr ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
msgid "Email changed"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-03 07:58+0200\n"
"POT-Creation-Date: 2023-03-04 10:33+0100\n"
"PO-Revision-Date: 2022-07-04 21:17+0000\n"
"Last-Translator: J. Lavoie <j.lavoie@net-c.ca>\n"
"Language: fr\n"
@ -84,6 +84,7 @@ msgstr ""
"ignorer ce courriel."
#: fittrackee/emails/templates/account_confirmation/body.html:22
#: fittrackee/emails/templates/data_export_ready/body.html:22
#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
#: fittrackee/emails/templates/password_reset_request/body.html:24
msgid ""
@ -97,6 +98,40 @@ msgstr ""
msgid "Use the link below to confirm your address email."
msgstr "Cliquez sur le lien ci-dessous pour confirmer votre adresse électronique."
#: fittrackee/emails/templates/data_export_ready/body.html:2
#: fittrackee/emails/templates/data_export_ready/subject.txt:1
msgid "Your archive is ready to be downloaded"
msgstr "Votre archive est prête à être téléchargée"
#: fittrackee/emails/templates/data_export_ready/body.html:3
msgid "A download link is available in your account."
msgstr "Un lien de téléchargement est disponible dans votre compte."
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:1
msgid "You have requested an export of your account on FitTrackee."
msgstr "Vous avez demandé un export des données de votre compte sur FitTrackee."
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:2
msgid "The archive is now ready to be downloaded from your account."
msgstr "L'archive est maintenant prête à être téléchargée depuis votre compte."
#: fittrackee/emails/templates/data_export_ready/body.html:11
#: fittrackee/emails/templates/data_export_ready/body.txt:4
msgid "Download your archive"
msgstr "Télécharger votre archive"
#: fittrackee/emails/templates/data_export_ready/body.html:18
#: fittrackee/emails/templates/data_export_ready/body.txt:5
msgid ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
msgstr ""
"Si vous n'êtes pas à l'origine de cette demande, veuillez changer "
"votre mot de passe immédiatement ou contacter l'administrateur si votre "
"compte est bloqué."
#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
msgid "Email changed"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-03 07:58+0200\n"
"POT-Creation-Date: 2023-03-04 10:33+0100\n"
"PO-Revision-Date: 2022-12-12 19:48+0000\n"
"Last-Translator: Donato Perruso <dperruso@protonmail.com>\n"
"Language: it\n"
@ -84,6 +84,7 @@ msgstr ""
"ignora quest'email."
#: fittrackee/emails/templates/account_confirmation/body.html:22
#: fittrackee/emails/templates/data_export_ready/body.html:22
#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
#: fittrackee/emails/templates/password_reset_request/body.html:24
msgid ""
@ -97,6 +98,37 @@ msgstr ""
msgid "Use the link below to confirm your address email."
msgstr "Usa il link qui sotto per confermare la tua email."
#: fittrackee/emails/templates/data_export_ready/body.html:2
#: fittrackee/emails/templates/data_export_ready/subject.txt:1
msgid "Your archive is ready to be downloaded"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:3
msgid "A download link is available in your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:1
msgid "You have requested an export of your account on FitTrackee."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:2
msgid "The archive is now ready to be downloaded from your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:11
#: fittrackee/emails/templates/data_export_ready/body.txt:4
msgid "Download your archive"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:18
#: fittrackee/emails/templates/data_export_ready/body.txt:5
msgid ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
msgstr ""
#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
msgid "Email changed"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-03 07:58+0200\n"
"POT-Creation-Date: 2023-03-04 10:33+0100\n"
"PO-Revision-Date: 2022-10-31 10:19+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: nb\n"
@ -79,6 +79,7 @@ msgid ""
msgstr ""
#: fittrackee/emails/templates/account_confirmation/body.html:22
#: fittrackee/emails/templates/data_export_ready/body.html:22
#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
#: fittrackee/emails/templates/password_reset_request/body.html:24
msgid ""
@ -90,6 +91,37 @@ msgstr ""
msgid "Use the link below to confirm your address email."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:2
#: fittrackee/emails/templates/data_export_ready/subject.txt:1
msgid "Your archive is ready to be downloaded"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:3
msgid "A download link is available in your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:1
msgid "You have requested an export of your account on FitTrackee."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:2
msgid "The archive is now ready to be downloaded from your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:11
#: fittrackee/emails/templates/data_export_ready/body.txt:4
msgid "Download your archive"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:18
#: fittrackee/emails/templates/data_export_ready/body.txt:5
msgid ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
msgstr ""
#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
msgid "Email changed"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-03 07:58+0200\n"
"POT-Creation-Date: 2023-03-04 10:33+0100\n"
"PO-Revision-Date: 2022-11-29 00:47+0000\n"
"Last-Translator: bjornclauw <bjorn.clauw.1@gmail.com>\n"
"Language: nl\n"
@ -82,6 +82,7 @@ msgid ""
msgstr "Indien u deze account niet hebt aangemaakt, gelieve deze email te negeren."
#: fittrackee/emails/templates/account_confirmation/body.html:22
#: fittrackee/emails/templates/data_export_ready/body.html:22
#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
#: fittrackee/emails/templates/password_reset_request/body.html:24
msgid ""
@ -95,6 +96,37 @@ msgstr ""
msgid "Use the link below to confirm your address email."
msgstr "Gebruik de onderstaande link om uw email adres te bevestigen."
#: fittrackee/emails/templates/data_export_ready/body.html:2
#: fittrackee/emails/templates/data_export_ready/subject.txt:1
msgid "Your archive is ready to be downloaded"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:3
msgid "A download link is available in your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:1
msgid "You have requested an export of your account on FitTrackee."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:4
#: fittrackee/emails/templates/data_export_ready/body.txt:2
msgid "The archive is now ready to be downloaded from your account."
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:11
#: fittrackee/emails/templates/data_export_ready/body.txt:4
msgid "Download your archive"
msgstr ""
#: fittrackee/emails/templates/data_export_ready/body.html:18
#: fittrackee/emails/templates/data_export_ready/body.txt:5
msgid ""
"If you did not request the export, please change your password "
"immediately or contact your administrator if your account is locked."
msgstr ""
#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
msgid "Email changed"