Class: FlagMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/flag_mailer.rb

Instance Method Summary collapse

Instance Method Details

#flag_escalatedObject



4
5
6
7
8
9
10
11
12
13
# File 'app/mailers/flag_mailer.rb', line 4

def flag_escalated
  @flag = params[:flag]
  emails = User.joins(:community_user).where(is_global_admin: true)
               .or(User.joins(:community_user)
                       .where(community_users: { is_admin: true, community_id: @flag.community_id }))
               .select(:email).map(&:email)
  from = "#{SiteSetting['NoReplySenderName']} <#{SiteSetting['NoReplySenderEmail']}>"
  to = SiteSetting['NoReplySenderEmail']
  mail from: from, to: to, bcc: emails, subject: "New flag escalation on #{@flag.community.name}"
end