2021-01-02 19:28:03 +01:00
|
|
|
from typing import Dict
|
|
|
|
|
2020-09-16 15:41:02 +02:00
|
|
|
from fittrackee import dramatiq, email_service
|
2020-07-14 22:03:56 +02:00
|
|
|
|
|
|
|
|
2020-07-15 09:19:03 +02:00
|
|
|
@dramatiq.actor(queue_name='fittrackee_emails')
|
2021-01-02 19:28:03 +01:00
|
|
|
def reset_password_email(user: Dict, email_data: Dict) -> None:
|
2020-07-14 22:03:56 +02:00
|
|
|
email_service.send(
|
|
|
|
template='password_reset_request',
|
|
|
|
lang=user['language'],
|
|
|
|
recipient=user['email'],
|
|
|
|
data=email_data,
|
|
|
|
)
|
2022-03-13 08:56:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
@dramatiq.actor(queue_name='fittrackee_emails')
|
|
|
|
def email_updated_to_current_address(user: Dict, email_data: Dict) -> None:
|
|
|
|
email_service.send(
|
|
|
|
template='email_update_to_current_email',
|
|
|
|
lang=user['language'],
|
|
|
|
recipient=user['email'],
|
|
|
|
data=email_data,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@dramatiq.actor(queue_name='fittrackee_emails')
|
|
|
|
def email_updated_to_new_address(user: Dict, email_data: Dict) -> None:
|
|
|
|
email_service.send(
|
|
|
|
template='email_update_to_new_email',
|
|
|
|
lang=user['language'],
|
|
|
|
recipient=user['email'],
|
|
|
|
data=email_data,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@dramatiq.actor(queue_name='fittrackee_emails')
|
|
|
|
def password_change_email(user: Dict, email_data: Dict) -> None:
|
|
|
|
email_service.send(
|
|
|
|
template='password_change',
|
|
|
|
lang=user['language'],
|
|
|
|
recipient=user['email'],
|
|
|
|
data=email_data,
|
|
|
|
)
|
2022-03-19 22:02:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
@dramatiq.actor(queue_name='fittrackee_emails')
|
|
|
|
def account_confirmation_email(user: Dict, email_data: Dict) -> None:
|
|
|
|
email_service.send(
|
|
|
|
template='account_confirmation',
|
|
|
|
lang=user['language'],
|
|
|
|
recipient=user['email'],
|
|
|
|
data=email_data,
|
|
|
|
)
|
2023-03-04 10:49:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
@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,
|
|
|
|
)
|