Skip to content

Commit

Permalink
fix: Greek subject translation (M2-8252) (#1673)
Browse files Browse the repository at this point in the history
* fix: greek subject translation

* fix: renaming get_localized_subject to get_locallized_email_subject

---------

Co-authored-by: Ramir Mesquita <[email protected]>
  • Loading branch information
ramirlm and Ramir Mesquita authored Dec 5, 2024
1 parent 7abe781 commit 7def9b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/apps/users/services/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def __init__(self, session) -> None:
self._cache: PasswordRecoveryCache = PasswordRecoveryCache()
self.session = session

def get_locallized_email_subject(self, language: str) -> str:
subjects = {
"en": "Password reset",
"fr": "Réinitialisation du mot de passe",
"el": "Επαναφορά κωδικού πρόσβασης",
}
return subjects.get(language, "Password reset")

async def send_password_recovery(
self,
schema: PasswordRecoveryRequest,
Expand Down Expand Up @@ -91,7 +99,7 @@ async def send_password_recovery(

message = MessageSchema(
recipients=[user.email_encrypted],
subject="Password reset",
subject=self.get_locallized_email_subject(language),
body=service.get_localized_html_template(
template_name="reset_password",
language=language,
Expand Down

0 comments on commit 7def9b1

Please sign in to comment.