Allow sending test emails when mail is disabled?

AI-generated summary

The discussion revolves around the issue of sending test emails when mail is disabled. pfaffman discovered that mail tests silently fail when mail is disabled, with no logs or indication of failure. codinghorror agreed that an explicit warning is needed and assigned the task to sam.

Rishabh proposed three possible solutions:

  1. Allow admins to send test emails to any email address.
  2. Allow admins to send test emails to any user (not just admins).
  3. Add a warning that test emails can only be sent to another admin.

sam opted for the first option, and Rishabh subsequently merged the change, allowing admins to send test emails to any address when mail is disabled.

Now that we allow sending mail to admins when mail is disabled, might we enable sending mail go ANY address in the mail test field? I’ve been wondering for longer than I care to admin why none of my mail tests were appearing in the Mailgun logs.

It turns out mail is disabled, and the mail test silently fails. Nothing in logs, nothing in skipped. I was just writing a mean note to Mailgun when I figured out how it was my fault.

3 Likes

Hmm yeah we should add an explicit warning here @sam can you assign this out?

3 Likes

This is indeed a bit unpredictable, when disable email is set to non-staff,

  • sending a test mail to an admin email works as expected.
  • sending a test mail to any non-admin email fails silently.

IMO, we could:

  1. allow an admin to send a test email to ANY email address
  2. allow an admin to send a test email to any user (not just admins)
  3. add a warning that a test email can only be sent to another admin

I like Option 1 because it’s the most obvious but 2 and 3 would also help make this less confusing.

5 Likes

Sure… go with (1) sounds fine to me.

5 Likes

This is now merged, thanks @pfaffman :partying_face:

https://github.com/discourse/discourse/commit/c279792130e24dffbbdee8d6cbb0bad46cc13b72

5 Likes