Commit 1f05bbcccedc5e6a23a496946e97507368f528ea
1 parent
13f4f375
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
HOTSPOT: Fix email send
Showing
1 changed file
with
8 additions
and
10 deletions
Show diff stats
script/sent_proposal_report
| ... | ... | @@ -40,17 +40,15 @@ end |
| 40 | 40 | |
| 41 | 41 | file.close |
| 42 | 42 | |
| 43 | -message = <<MESSAGE_END | |
| 44 | - | |
| 45 | -Segue em anexo o relatorio do Dialoga. | |
| 46 | -MESSAGE_END | |
| 47 | - | |
| 48 | - | |
| 49 | 43 | ActionMailer::Base.logger = Logger.new(STDOUT) |
| 50 | -class Sender < ActionMailer::Base | |
| 51 | - def test(to, from) | |
| 44 | +class Sender < ActionMailer::Base | |
| 45 | + def send_report(to, from) | |
| 46 | + attachments["eventos.csv"] = File.read("#{Rails.root}/event.csv") | |
| 47 | + attachments["propostas.csv"] = File.read("#{Rails.root}/data.csv") | |
| 52 | 48 | mail to: to, from: from, |
| 53 | - subject: "Relatorio do Dialoga", body: message | |
| 49 | + subject: "Relatorio do Dialoga", body: "Segue em anexo os relatorios do Dialoga" | |
| 54 | 50 | end |
| 51 | + | |
| 55 | 52 | end |
| 56 | -Sender.test(emails, 'dialoga@dialoga.gov.br').deliver | |
| 53 | + | |
| 54 | +Sender.send_report(emails, 'dialoga@dialoga.gov.br').deliver | ... | ... |