Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Task Queue Subexample
@app.task(
name='send-email-to-user',
default_retry_delay=300,
max_retry=5,
soft_time_limit=30
)
def send_email_to_user(
user_email: str,
email_template: str,
extra_info: dict
):
_message = replace_fields_with_values(email_template, extra_info)
_sent = send_email(user_email, _message)
logging.info(f"Sent {email_template} email to user <{user_email}>")
return {
"email": user_email,
"email_type": email_template,
"email_status": _sent
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment