Class: Bible270::NoticeMailer

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

Overview

Notices to whoever runs the plan, as opposed to mail sent to readers.

Instance Method Summary collapse

Instance Method Details

#new_reader(reader_id:, recipients:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'app/mailers/bible270/notice_mailer.rb', line 6

def new_reader(reader_id:, recipients:)
  @reader = Reader.find_by(id: reader_id)
  return message.perform_deliveries = false if @reader.nil? || recipients.blank?

  @app_name = Bible270.config.app_name
  @total = Reader.count
  @admin_url = admin_url_for(@reader)

  mail to: recipients, subject: "#{@app_name}: #{@reader.display_name} has joined"
end