From 4c0c674f7b06478b5e3ea1707b5d836a40b8c62a Mon Sep 17 00:00:00 2001 From: Aart van Halteren Date: Fri, 9 Aug 2013 17:32:21 +0200 Subject: [PATCH] html update --- app/helpers/ReadingsMailer.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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!