FitTrackee/fittrackee/emails/tasks.py

64 lines
1.7 KiB
Python
Raw Permalink Normal View History

2021-01-02 19:28:03 +01:00
from typing import Dict
from fittrackee import dramatiq, email_service
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:
email_service.send(
template='password_reset_request',
lang=user['language'],
recipient=user['email'],
data=email_data,
)
@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,
)
@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,
)