diff --git a/app/helpers/ReadingsMailer.rb b/app/helpers/ReadingsMailer.rb index b4ca14d..fbdef4c 100644 --- a/app/helpers/ReadingsMailer.rb +++ b/app/helpers/ReadingsMailer.rb @@ -30,7 +30,7 @@ class ReadingsMailer delivery_method :smtp, smtp_opts to 'a.t.van.halteren@vu.nl' from 'SmartMeter ' - subject 'SmartMeter report' + subject "SmartMeter report for #{Date.today}" text_part do body "Summary for #{Date.today}\n @@ -41,10 +41,13 @@ class ReadingsMailer " end - # html_part do - # content_type 'text/html; charset=UTF-8' - # body '

This is HTML

' - # end + html_part do + content_type 'text/html; charset=UTF-8' + body "

Summary for #{Date.today}

" + + "

Total kWH electricity consumed: #{usage_today[:total_kwh_consumed_high] + usage_today[:total_kwh_consumed_low]}

" + + "

Total kWH electricity produced: #{usage_today[:total_kwh_produced_high] + usage_today[:total_kwh_produced_low]}

" + + "

Total m3 gas consumed: #{usage_today[:total_m3_gas_consumed]}

" + end end mail.deliver!