RQ task to send a verification email
https://redmine.teklia.com/issues/7318
The Register
endpoint sends the verification email immediately when called, but this can cause issues when the SMTP server is slow, out of service, or when we hit rate limits or other strange things that can happen with email. RFC 5321 sets minimum timeouts for each command sent over SMTP, so you could be waiting 17 minutes before you can start sending the email body, then 3 minutes for each TCP packet for the body, then 10 more minutes for the email to be sent when you're done.
A new RQ task should be added under a new arkindex.users.tasks
module, called send_verification_email
. It uses the default
queue. Its timeout is defined by a new job_timeouts.send_verification_email
setting, which defaults to 120
like the existing notify_process_completion
.
The email sending code Register
is now moved to that task. The send_mail
calls now should not fail silently, as we want the RQ task to crash if the email is not sent. This will allow for easier management of email failures, including the ability for sysadmins to retry sending those emails.
The Register
endpoint should now call a new trigger under arkindex.project.triggers
to run this task.