Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending emails should not block the main request but be sent async #2

Open
Ambient-Impact opened this issue May 16, 2023 · 0 comments
Labels
bug Something isn't working performance Make stuff go faster

Comments

@Ambient-Impact
Copy link
Member

Ambient-Impact commented May 16, 2023

The SMTP server can be slow, like several seconds slow, which holds up the response from Drupal when submitting a form or performing an action that has to send an email, such as a user with elevated roles logging in. We'll need to be able to send mail asynchronously after the response is sent to the browser.

Symptoms

Requirements

  1. Sending mail needs to not delay sending the response to the browser.
  2. Sending mail needs to happen as quickly as possible, so that time sensitive emails arrive in a reasonable amount of time, ideally not noticeably delayed compared to sending synchronously; for example, a password reset email is expected to arrive within 30 seconds or less from submitting the form, so we can't rely on waiting for cron to run to do this. See The quest for a more intelligent queue system that supports prioritizing, parallel processing, etc. #3

Solutions

It looks like the Queue Mail module might be just what we need to satisfy requirement 1, but it doesn't seem to concern itself how the queue is processed, which means that requirement 2 is something we'll need to solve ourselves or find a module/library to handle that.

Symfony Mailer

Additionally, the Drupal Symfony Mailer module (see #1) doesn't support queuing (though Symfony Mailer itself does), and the Queue Mail module doesn't support the Drupal Symfony Mailer module because ugh, so we may have to contribute that if no one else does by the time we get to this. Edit: See Symfony Messenger details in #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance Make stuff go faster
Projects
None yet
Development

No branches or pull requests

1 participant