When site require approvals for users, email replies do not get sent to staged users


(Stephen Chung) #1

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?

(Mittineague) #2

Are they not getting notified of replies to topics they started as a staged user?


(Jeff Atwood) #3

Quite possibly, what do you think @sam?


(Stephen Chung) #4

Correct. Even if they originated the topics via rmail, they won’t get reply emails. The return statement blocks it.


(Sam Saffron) #5

Will write a test for this later today


(Sam Saffron) #7

Fixed per:

Thanks for the report!


(Sam Saffron) #8