2019-07-30 21:29:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-25 16:15:39 +00:00
|
|
|
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
2018-03-25 17:30:42 +00:00
|
|
|
class GenericMailer < BaseMailer
|
2019-07-30 21:29:24 +00:00
|
|
|
def generic_mail(from_email, from_name, message, subject, to_email, _to_name)
|
2018-03-25 17:30:42 +00:00
|
|
|
@from_email = from_email
|
|
|
|
@from_name = from_name
|
|
|
|
@message = message
|
2020-06-10 22:31:47 +00:00
|
|
|
mail(to: to_email, from: "#{from_name} <#{Houdini.support_email}>", reply_to: from_email, subject: subject.to_s)
|
2018-03-25 17:30:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# For sending a system notice to super admins
|
|
|
|
def admin_notice(options)
|
2020-06-10 22:31:47 +00:00
|
|
|
@from_email = Houdini.support_email
|
2018-03-25 17:30:42 +00:00
|
|
|
@from_name = 'CC Bot'
|
|
|
|
@message = options[:body]
|
|
|
|
emails = QueryUsers.super_admin_emails
|
|
|
|
mail(to: emails, from: "#{@from_name} <#{@from_email}>", reply_to: @from_email, subject: options[:subject], template_name: 'generic_mail')
|
|
|
|
end
|
|
|
|
end
|