]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/notifier_helper.rb
Use the same fonts for the footer text as for the rest of the mail
[rails.git] / app / helpers / notifier_helper.rb
index 0510ae0a89280dc97d5bb3ef0c2eb2e21d54ea36..23ee45648267d826139b8ae3fc690199e5c5696a 100644 (file)
@@ -14,8 +14,15 @@ module NotifierHelper
 
   def message_body(&block)
     render(
-      partial: "message_body",
-      locals: { body: capture(&block) }
+      :partial => "message_body",
+      :locals => { :body => capture(&block) }
     )
   end
+
+  def style_message(html)
+    # Because we can't use stylesheets in HTML emails, we need to inline the
+    # styles. Rather than copy-paste the same string of CSS into every message,
+    # we apply it once here, after the message has been composed.
+    html.gsub /<p>/, '<p style="color: black; margin: 0.75em 0; font-family: \'Helvetica Neue\', Arial, Sans-Serif">'
+  end
 end