Child pages
  • [emails] Asynchronous e-mail sending by default [5.3.0-B1]
Skip to end of metadata
Go to start of metadata

In-Portal support 2 ways of sending e-mails:

  • immediate - e-mail is sent immediately
  • queued - e-mail is put into queue and then all queued e-mail are sent within next 30 minutes

By default all e-mails are sent immediately and this creates following problems:

  1. page, which caused e-mail sending, is frozen until e-mail is completely sent
  2. any fatal errors, that might happen during parsing e-mail template text result in user getting white screen

I'm proposing to:

  1. wrap e-mail template parsing in some sort of check code, that would:
    1. catch error if any
    2. write down this error into "System Log"
    3. don't send e-mail with parsing error
    4. allow code, that follows after e-mail sending to continue running
  2. send all e-mails asynchronously (e.g. put them into queue) with option to override this on per e-mail basis
  3. don't wait 30 minutes to send an e-mail, but rather send e-mail as soon as possible

delayed_email_sending_feat.patch - only implements 2 and 3 items of proposed

Related Tasks

INP-1223 - Getting issue details... STATUS

INP-1710 - Getting issue details... STATUS

INP-1224 - Getting issue details... STATUS

INP-1304 - Getting issue details... STATUS

3 Comments

  1. I like your idea. I'd also add "b1. send an email to admin about error", because an unsent email is a serious problem (order confirmation, reply from webmaster, customer relationship...).

  2. If e-mail content is so corrupted, that even record in e-mail queue wasn't created, then this surely needs to be indicated in "System Log".

  3. After completing both tasks I've got an idea to add record to "E-mail Log" even if there were an error during its processing. Basically we need to:

    1. add "Status" (Sent, Error) field to EmailLog table
    2. add "ErrorMessage" field to EmailLog table
    3. write record to EmailLog table instead of SystemLog table in case of error.

    This way we will be able to detect which e-mail wasn't sent and why.

    INP-1304 - Getting issue details... STATUS