recordtransfer.emails - Async email functions
Each function in the emails.py file is a django_rq.job, meaning that these functions are
meant to run asynchronously.
Email notifications sent by recordtransfer application.
- recordtransfer.emails.send_password_reset_email(context: dict) None
Send a password reset email asynchronously using django_rq.
- Parameters:
context – Context variables for the email, including: - email: The recipient’s email address - user: The User object for the recipient
- recordtransfer.emails.send_submission_creation_failure(form_data: dict, user_submitted: User, recipient_emails: List[str] | None = None, language: str | None = None) None
Send an email to users who get submission email updates that a user submitted a new submission and there WERE errors.
- Parameters:
form_data (dict) – A dictionary of the cleaned form data from the submission form. This is NOT the CAAIS tree version of the form.
user_submitted (User) – The user that tried to create the submission.
recipient_emails – Optional list of recipient emails. If provided, overrides the default admin recipients.
language – Optional language code to use for rendering the email. Only used when recipient_emails is provided.
- recordtransfer.emails.send_submission_creation_success(form_data: dict, submission: Submission, recipient_emails: List[str] | None = None, language: str | None = None) None
Send an email to users who get submission email updates that a user submitted a new submission and there were no errors.
- Parameters:
form_data – A dictionary of the cleaned form data from the submission form. This is NOT the CAAIS tree version of the form.
submission – The new submission that was created.
recipient_emails – Optional list of recipient emails. If provided, overrides the default admin recipients.
language – Optional language code to use for rendering the email. Only used when recipient_emails is provided.
- recordtransfer.emails.send_thank_you_for_your_submission(form_data: dict, submission: Submission) None
Send a submission success email to the user who made the submission.
- Parameters:
form_data – A dictionary of the cleaned form data from the submission form. This is NOT the CAAIS tree version of the form.
submission – The new submission that was created.
- recordtransfer.emails.send_user_account_updated(user_updated: User, context_vars: dict) None
Send a notice that the user’s account has been updated.
- Parameters:
user_updated – The user whose account was updated.
context_vars – Template context variables.
- recordtransfer.emails.send_user_activation_email(new_user: User) None
Send an activation email to the new user who is attempting to create an account. The user must visit the link to activate their account.
- Parameters:
new_user – The new user who requested an account
- recordtransfer.emails.send_your_submission_did_not_go_through(form_data: dict, user_submitted: User) None
Send a submission failure email to the user who made the submission.
- Parameters:
form_data – A dictionary of the cleaned form data from the submission form. This is NOT the CAAIS tree version of the form.
user_submitted – The user that tried to create the submission.