html update

This commit is contained in:
Aart van Halteren
2013-08-09 17:32:21 +02:00
parent b3b061a480
commit 4c0c674f7b

View File

@@ -30,7 +30,7 @@ class ReadingsMailer
delivery_method :smtp, smtp_opts delivery_method :smtp, smtp_opts
to 'a.t.van.halteren@vu.nl' to 'a.t.van.halteren@vu.nl'
from 'SmartMeter <aart@van-halteren.net>' from 'SmartMeter <aart@van-halteren.net>'
subject 'SmartMeter report' subject "SmartMeter report for #{Date.today}"
text_part do text_part do
body "Summary for #{Date.today}\n body "Summary for #{Date.today}\n
@@ -41,10 +41,13 @@ class ReadingsMailer
" "
end end
# html_part do html_part do
# content_type 'text/html; charset=UTF-8' content_type 'text/html; charset=UTF-8'
# body '<h1>This is HTML</h1>' body "<h1>Summary for #{Date.today}</h1>" +
# end "<p>Total kWH electricity consumed: #{usage_today[:total_kwh_consumed_high] + usage_today[:total_kwh_consumed_low]}</p>" +
"<p>Total kWH electricity produced: #{usage_today[:total_kwh_produced_high] + usage_today[:total_kwh_produced_low]}</p>" +
"<p>Total m3 gas consumed: #{usage_today[:total_m3_gas_consumed]}</p>"
end
end end
mail.deliver! mail.deliver!