app/mailers/report_mailer.rb
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
#   en.report_mailer.weekly_email.subject
#
Subject can be set in your I18n file at config/locales/en.yml
with the following lookup.


Subject can be set in your I18n file at config / locales / en . yml with the following lookup .
def weekly_email
    @end_date = Date.tomorrow
    @report = HoursReport.for_week(ending: @end_date)
    @report.pull_join
    attachments['WeeklyReport.csv'] = @report.to_csv
    email = mail(subject: 'Weekly Report')
    raise 'there are no recipients' if email[:to].addresses.empty?
    email
  end
def weekly_email @end_date = Date . tomorrow @report = HoursReport . for_week ( ending : @end_date ) @report . pull_join attachments [ 'WeeklyReport.csv' ] = @report . to_csv email = mail ( subject : 'Weekly Report' ) raise 'there are no recipients' if email [ :to ] . addresses . empty? email end
Subject can be set in your I18n file at config/locales/en.yml
with the following lookup:
Subject can be set in your I18n file at config / locales / en . yml with the following lookup :