Hey,
So I'm not entirely sure, but from my local environment I'm not seeing anywhere that event organizers are being notified that their event was approved. My process is to, as an Admin, create an event with the "send announcement to chapter when event is approved" unchecked. Then, I navigate to /events/unpublished_events and click "publish," only to be notified that "Are you sure? This will email 0 members of RailsBridge San Francisco." Indeed, no emails are sent according to my console.
It seems important that if an event organizer does not want their announcement email to be sent at the time of approval but at some other time (
a feature I am hoping to build) or never, they should be notified when they get their event approved.
The code seems to support this hypothesis as well. Inside "event_mailer.rb" the "new_event" method only sends emails by:
set_recipients(User.joins(:chapters).where('users.allow_event_email = ?', true).where('chapters.id' => [@chapter.id]).map(&:email))
basically, by chapters. The "unpublished_event_controller.rb" uses this same "event_mailer" action to send emails once an email is published. A possible fix would be to do some mixture of "event_mailer"'s "new_event" and "unpublished_event" methods.
Am I approving events correctly? Should I go ahead and "fix" publishing new events to notify the admin that they have had there event approved?