From f63609a7985302f692bf1213169c956cb2d7a444 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 30 Jun 2022 16:44:12 +0200 Subject: [PATCH] Add helpers for mailer footer styles --- app/helpers/mailer_helper.rb | 12 ++++++++++++ app/mailers/application_mailer.rb | 1 + app/mailers/mailer.rb | 1 - app/views/layouts/_mailer_footer.html.erb | 10 ++++++---- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb index 61e3bd465..3ec9bfdc7 100644 --- a/app/helpers/mailer_helper.rb +++ b/app/helpers/mailer_helper.rb @@ -24,6 +24,10 @@ module MailerHelper "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;" end + def mailer_footer_spacing + "margin: 0;padding: 0;line-height: 1.5em;" + end + def css_for_mailer_heading mailer_font_family + "font-size: 48px;" end @@ -36,6 +40,14 @@ module MailerHelper mailer_font_family + "font-size: 14px;font-weight: normal;line-height: 24px;" 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 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 diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index f44f0ac0d..7ccbcecd5 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,6 +1,7 @@ class ApplicationMailer < ActionMailer::Base helper :settings helper :application + helper :mailer default from: proc { "#{Setting["mailer_from_name"]} <#{Setting["mailer_from_address"]}>" } layout "mailer" end diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 1f6707e29..324252a2a 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -2,7 +2,6 @@ class Mailer < ApplicationMailer after_action :prevent_delivery_to_users_without_email helper :text_with_links - helper :mailer helper :users def comment(comment) diff --git a/app/views/layouts/_mailer_footer.html.erb b/app/views/layouts/_mailer_footer.html.erb index 3cdf2db52..7177dbb1a 100644 --- a/app/views/layouts/_mailer_footer.html.erb +++ b/app/views/layouts/_mailer_footer.html.erb @@ -2,11 +2,13 @@ -

- <%= setting["org_name"] %>

+

+ <%= setting["org_name"] %> +

-

- <%= t("mailers.no_reply") %>

+

+ <%= t("mailers.no_reply") %> +