Created
June 30, 2021 12:27
-
-
Save bilalozdemir/3c0866d0de2cc5c7a3101fb652c8a424 to your computer and use it in GitHub Desktop.
Task Queue Subexample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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