Merge pull request #4864 from consul/unsubscribe_emails

Add helpers for mailer footer styles
This commit is contained in:
Javi Martín
2022-08-19 17:18:35 +02:00
committed by GitHub
4 changed files with 19 additions and 5 deletions

View File

@@ -24,6 +24,10 @@ module MailerHelper
"font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;" "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;"
end end
def mailer_footer_spacing
"margin: 0;padding: 0;line-height: 1.5em;"
end
def css_for_mailer_heading def css_for_mailer_heading
mailer_font_family + "font-size: 48px;" mailer_font_family + "font-size: 48px;"
end end
@@ -36,6 +40,14 @@ module MailerHelper
mailer_font_family + "font-size: 14px;font-weight: normal;line-height: 24px;" mailer_font_family + "font-size: 14px;font-weight: normal;line-height: 24px;"
end end
def css_for_mailer_org
mailer_font_family + mailer_footer_spacing + "color: #797f7f; font-size: 12px;"
end
def css_for_mailer_footer
mailer_font_family + mailer_footer_spacing + "color: #222; font-size: 10px; margin-top: 12px;"
end
def css_for_mailer_button def css_for_mailer_button
mailer_font_family + "background: #004a83;border-radius: 6px;color: #fff!important;display: inline-block;font-weight: bold;margin: 0;min-width: 200px;padding: 10px 15px;text-align: center;text-decoration: none;" mailer_font_family + "background: #004a83;border-radius: 6px;color: #fff!important;display: inline-block;font-weight: bold;margin: 0;min-width: 200px;padding: 10px 15px;text-align: center;text-decoration: none;"
end end

View File

@@ -1,6 +1,7 @@
class ApplicationMailer < ActionMailer::Base class ApplicationMailer < ActionMailer::Base
helper :settings helper :settings
helper :application helper :application
helper :mailer
default from: proc { "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>" } default from: proc { "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>" }
layout "mailer" layout "mailer"
end end

View File

@@ -2,7 +2,6 @@ class Mailer < ApplicationMailer
after_action :prevent_delivery_to_users_without_email after_action :prevent_delivery_to_users_without_email
helper :text_with_links helper :text_with_links
helper :mailer
helper :users helper :users
def comment(comment) def comment(comment)

View File

@@ -2,11 +2,13 @@
<tbody> <tbody>
<tr> <tr>
<td style="text-align: center; border-top: 1px solid #dadfe1; padding-top: 20px;"> <td style="text-align: center; border-top: 1px solid #dadfe1; padding-top: 20px;">
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; margin: 0;padding: 0;line-height: 1.5em;color: #797f7f; font-size: 12px;"> <p style="<%= css_for_mailer_org %>">
<%= setting["org_name"] %></p> <%= setting["org_name"] %>
</p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; margin: 0;padding: 0;line-height: 1.5em;color: #222; font-size: 10px; margin-top: 12px;"> <p style="<%= css_for_mailer_footer %>">
<%= t("mailers.no_reply") %></p> <%= t("mailers.no_reply") %>
</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>