1 # frozen_string_literal: true
3 module UserMailerHelper
5 format_paragraph(text, 72, 0)
8 def link_to_user(display_name)
12 # NB we need "text-decoration: none" twice: GMail only honours it on
13 # the <a> but Outlook only on the <strong>
14 :style => "text-decoration: none"
16 user_url(display_name, :host => Settings.server_url),
19 :style => "text-decoration: none; color: #222"
25 :partial => "message_body",
26 :locals => { :body => capture(&) }
30 def style_message(html)
31 # Because we can't use stylesheets in HTML emails, we need to inline the
32 # styles. Rather than copy-paste the same string of CSS into every message,
33 # we apply it once here, after the message has been composed.
34 html.gsub("<p>", '<p style="color: black; margin: 0.75em 0; font-family: \'Helvetica Neue\', Arial, Sans-Serif">').html_safe
38 I18n.t("html.dir") == "ltr" ? "left" : "right"
42 I18n.t("html.dir") == "ltr" ? "right" : "left"