Skip to content

Commit

Permalink
Fix: add mail template for TOS signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotheem committed Jan 15, 2025
1 parent 4627e5c commit d815a53
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
18 changes: 14 additions & 4 deletions app/core/myeclpay/endpoints_myeclpay.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,12 +939,23 @@ async def delete_store_seller(
await db.commit()


@router.get(
"/myeclpay/tos",
status_code=200,
)
async def get_tos():
"""
Get the latest TOS version and the TOS content.
"""
return TOS_CONTENT


@router.get(
"/myeclpay/users/me/tos",
status_code=200,
response_model=schemas_myeclpay.TOSSignatureResponse,
)
async def get_tos(
async def get_user_tos(
db: AsyncSession = Depends(get_db),
user: CoreUser = Depends(is_user()),
):
Expand Down Expand Up @@ -1070,15 +1081,14 @@ async def sign_tos(
# hyperion_security_logger.warning(
# f"Create_user: an user with email {user_create.email} already exists ({request_id})",
# )
# TODO: change template
if settings.SMTP_ACTIVE:
account_exists_content = templates.get_template(
"account_exists_mail.html",
"myeclpay_signed_tos_mail.html",
).render()
background_tasks.add_task(
send_email,
recipient=user.email,
subject="MyECL - you have signed TOS",
subject="MyECL - You signed the Terms of Service for MyECLPay",
content=account_exists_content,
settings=settings,
)
Expand Down
31 changes: 31 additions & 0 deletions assets/templates/myeclpay_signed_tos_mail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "base_mail.html" %}

{% block title %}MyECL - You signed the Terms of Service for MyECLPay {% endblock %}

{% block french_message %}
<h1> Vous avez signé les Conditions Générales d'Utilisation de MyECLPay</h1>
<p>
Vous avez signé les Conditions Générales d'Utilisation de MyECLPay.
Vous pouvez les consulter à tout moment en cliquant sur ce
<a href="https://myecl.fr/myeclpay/tos">lien</a>.

<br><br>

Si vous n'êtes pas à l'origine de cette action, changez immédiatement votre mot de passe, votre compte a pu être
compromis.

</p>
{% endblock %}

{% block english_message %}
<h1> You signed the Terms of Service for MyECLPay</h1>
<p>
You signed the Terms of Service for MyECLPay.
You can consult them at any time by clicking on this
<a href="https://myecl.fr/myeclpay/tos">link</a>.

<br><br>

If you did not initiate this action, change your password immediately, your account may have been compromised.
</p>
{% endblock %}

0 comments on commit d815a53

Please sign in to comment.