After restore, sending email invites don't work

AI-generated summary

After restoring a Discourse instance, frank.manuel encountered an issue with sending email invites. Despite no error logs or messages, and “Send Test Email” and “rake admin:invite” working, the “Invite by Email” feature failed.

Steven suggested checking the disable email setting, which was set to “non-staff” after the import. This setting blocks emails from being sent to non-staff members until it’s set to “no”.

frank.manuel confirmed this was the issue and Steven explained that the setting is intended to prevent emails from being sent to non-staff members immediately after a restore.

frank.manuel suggested adding a notice on the Invite page about the dependency on the disable_emails setting, but riking pointed out that a global banner typically handles this notification. frank.manuel acknowledged that they missed the banner and appreciated the clarification.

After cloning my discourse instance, it seems “Invite by Email” doesn’t work.

“Send Test Email” and “rake admin:invite” both work, but sending an invite email via the Invites page doesn’t work.(neither does Resend).

There are no error logs or error messages, and no failed tasks on sidekiq.

Thanks.

Can you check that the setting disable email is set to no (it is set to yes or non-staff after an import). If you hid the alert banners via css, you may not know that after an import the emails sent with discourse are blocked until you act on it.

This is it, thanks! It was set to “non-staff”, which is odd because I’m pretty sure I was staff when i tried to invite. Anyway, I set it to “no”, and it works now.

I didn’t know know imports didn’t make a 100% faithful copy. Although I guess this is somewhat documented here.

Thanks again.

In this instance, non staff means that it will only send emails to staff members, because right after an restore you might need to make sure everything is ok before the forum send anything.

If you need to rebuild again, rebake or if the avatars are not already regenerated, it’s best to not have everyone coming back right now.

Thanks!

I have to say though, it would be nice if the Invite page had some notice that it was dependent on the disable_emails setting, if emails is disabled. Something along the lines of

“Invite by email” and “Resend invite” require that the “disable emails” setting is set to “no”, otherwise no email will be sent.

This is usually taken care of by the global banner, I see no reason to add a second copy to the invite form?

Oh, you’re right. I didn’t notice the banner. It appeared between the “Enabled notifications” and “Let’s start the discussion”, and I got so used to the banners up there that they just disappeared for me.

Thanks.