In notification_emailer.rb
:
def perform_enqueue(type, delay)
user = notification.user
return unless user.active? || user.staged?
return if SiteSetting.must_approve_users? && !user.approved?
return unless EMAILABLE_POST_TYPES.include?(post_type)
Jobs.enqueue_in(delay, :user_email, self.class.notification_params(notification, type))
end
The line:
return if SiteSetting.must_approve_users? && !user.approved?
is suspect because staged users are obviously NOT approved… it would be rather strange for a user to be staged but then approved.
Therefore the whole thing falls apart if the forum is set to require approval.
I’m pretty sure the code should be:
return if SiteSetting.must_approve_users? && !user.staged? && !user.approved?