diff --git a/app/assets/stylesheets/mail/all.scss b/app/assets/stylesheets/mail/all.scss index fa8445d726..1b00c44995 100644 --- a/app/assets/stylesheets/mail/all.scss +++ b/app/assets/stylesheets/mail/all.scss @@ -1,3 +1,4 @@ @import '../../../webpacker/css/admin/globals/palette.scss'; @import 'email'; @import 'payments_list'; +@import '../../../webpacker/css/darkswarm/style.scss'; diff --git a/app/assets/stylesheets/mail/email.scss b/app/assets/stylesheets/mail/email.scss index 844cd3b342..caa20499ca 100644 --- a/app/assets/stylesheets/mail/email.scss +++ b/app/assets/stylesheets/mail/email.scss @@ -55,18 +55,29 @@ p.callout { color: #0096ad; } +p.footer, p.footer_icons a { + color: #999; +} + +p.footer_icons { + font-size: 0px; + + a { + text-decoration: none; + margin-right: 5px; + } +} + +p.footer_icons a:not(.ofn-i_image) { + font-size: 20px; +} + p.notice { font-style: italic; font-size: 12px; margin-top: 20px; } -.powered-by-ofn { - background-color: #ebebeb; - padding: .5em; - text-align: center; -} - table.social { background-color: #ebebeb; @@ -177,11 +188,12 @@ del.quantity_was { } /* ------------------------------------- - * HEADER + * HEADER & FOOTER *------------------------------------- */ -table.head-wrap { +.wrap { width: 100%; + background-color: #f2f2f2; } .header.container table td { diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb index b07b04ca45..7d4fb3bbee 100644 --- a/app/helpers/mailer_helper.rb +++ b/app/helpers/mailer_helper.rb @@ -1,16 +1,6 @@ # frozen_string_literal: true module MailerHelper - def footer_ofn_link - ofn = I18n.t("shared.mailers.powered_by.open_food_network") - - if ContentConfig.footer_email.present? - mail_to ContentConfig.footer_email, ofn - else - link_to ofn, "https://www.openfoodnetwork.org" - end - end - def order_reply_email(order) order.distributor.email_address.presence || order.distributor.contact.email end diff --git a/app/mailers/payment_mailer.rb b/app/mailers/payment_mailer.rb index ae38604b98..3a10103fe8 100644 --- a/app/mailers/payment_mailer.rb +++ b/app/mailers/payment_mailer.rb @@ -2,6 +2,7 @@ class PaymentMailer < ApplicationMailer include I18nHelper + helper MailerHelper def authorize_payment(payment) @payment = payment diff --git a/app/mailers/spree/shipment_mailer.rb b/app/mailers/spree/shipment_mailer.rb index 0be7b55cca..c5d3307571 100644 --- a/app/mailers/spree/shipment_mailer.rb +++ b/app/mailers/spree/shipment_mailer.rb @@ -2,6 +2,8 @@ module Spree class ShipmentMailer < ApplicationMailer + helper MailerHelper + def shipped_email(shipment, delivery:) @shipment = shipment.respond_to?(:id) ? shipment : Spree::Shipment.find(shipment) @delivery = delivery diff --git a/app/mailers/spree/user_mailer.rb b/app/mailers/spree/user_mailer.rb index 3797fcd9b4..6f2853de2b 100644 --- a/app/mailers/spree/user_mailer.rb +++ b/app/mailers/spree/user_mailer.rb @@ -6,8 +6,6 @@ module Spree class UserMailer < ApplicationMailer include I18nHelper - helper MailerHelper - # Overrides `Devise::Mailer.reset_password_instructions` def reset_password_instructions(user, token, _opts = {}) @edit_password_reset_url = spree. diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index 46b7078516..4e5739ba79 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -8,7 +8,7 @@ = stylesheet_link_tag 'mail' %body{:bgcolor => "#FFFFFF" } - unless @hide_ofn_navigation - %table.head-wrap{:bgcolor => "#f2f2f2"} + %table.wrap %tr %td %td.header.container @@ -34,15 +34,39 @@ = yield %td - %table.footer-wrap + %table.wrap %tr %td %td.container .content %table %tr - %td{:align => "center"} - %p + %td.text-center + %p.footer + = t(".powered_html", open_food_network: link_to(t(".open_food_network"), "https://www.openfoodnetwork.org", target: '_blank')) + + %tr + %td.text-center + %p.footer_icons + - if ContentConfig.footer_email.present? + %a.ofn-i_050-mail-circle{:href => "mailto:#{ContentConfig.footer_email}", :target => "_blank"} + - if ContentConfig.footer_instagram_url.present? + %a.ofn-i_043-instagram{:href => ContentConfig.footer_instagram_url, :target => "_blank"} + - if ContentConfig.footer_facebook_url.present? + %a.ofn-i_044-facebook{:href => ContentConfig.footer_facebook_url, :target => "_blank"} + - if ContentConfig.footer_linkedin_url.present? + %a.ofn-i_042-linkedin{:href => ContentConfig.footer_linkedin_url, :target => "_blank"} + - if ContentConfig.footer_googleplus_url.present? + %a.ofn-i_046-g{:href => ContentConfig.footer_googleplus_url, :target => "_blank"} + - if ContentConfig.footer_pinterest_url.present? + %a.ofn-i_045-pintrest{:href => ContentConfig.footer_pinterest_url, :target => "_blank"} + - if ContentConfig.footer_twitter_url.present? + %a.ofn-i_image{:href => ContentConfig.footer_twitter_url, :target => "_blank"} + %img{src: image_path("/map_icons/social-logos/x999.png"), style: "width: 20px; position: relative; top: 1.5px;" } + + %tr + %td.text-center + %p.footer - if platform_terms_required? = link_to_platform_terms | diff --git a/app/views/shared/mailers/_powered_by.html.haml b/app/views/shared/mailers/_powered_by.html.haml deleted file mode 100644 index 1d71037a9a..0000000000 --- a/app/views/shared/mailers/_powered_by.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%p.powered-by-ofn - = t(".powered_html", open_food_network: footer_ofn_link) diff --git a/app/views/spree/order_mailer/cancel_email.html.haml b/app/views/spree/order_mailer/cancel_email.html.haml index edfc66f162..e96d2bdeb2 100755 --- a/app/views/spree/order_mailer/cancel_email.html.haml +++ b/app/views/spree/order_mailer/cancel_email.html.haml @@ -27,4 +27,3 @@ = t(".unpaid_order") = render 'signoff' -= render 'shared/mailers/powered_by' diff --git a/app/views/spree/order_mailer/confirm_email_for_customer.html.haml b/app/views/spree/order_mailer/confirm_email_for_customer.html.haml index 8894805243..4d85b463b1 100644 --- a/app/views/spree/order_mailer/confirm_email_for_customer.html.haml +++ b/app/views/spree/order_mailer/confirm_email_for_customer.html.haml @@ -26,4 +26,3 @@ = render 'shipping' = render 'special_instructions' = render 'signoff' -= render 'shared/mailers/powered_by' diff --git a/app/views/spree/user_mailer/confirmation_instructions.html.haml b/app/views/spree/user_mailer/confirmation_instructions.html.haml index 2a7852d94f..20d2424a4a 100644 --- a/app/views/spree/user_mailer/confirmation_instructions.html.haml +++ b/app/views/spree/user_mailer/confirmation_instructions.html.haml @@ -12,7 +12,5 @@ = render 'shared/mailers/signoff' -= render 'shared/mailers/powered_by' - %p.notice = t :email_confirmation_notice_unexpected, sitename: @instance, contact: @contact diff --git a/app/views/subscription_mailer/confirmation_summary_email.html.haml b/app/views/subscription_mailer/confirmation_summary_email.html.haml index 4cdefdffe1..ed53f341a1 100644 --- a/app/views/subscription_mailer/confirmation_summary_email.html.haml +++ b/app/views/subscription_mailer/confirmation_summary_email.html.haml @@ -20,4 +20,3 @@ %p   = render 'shared/mailers/signoff' -= render 'shared/mailers/powered_by' diff --git a/app/views/subscription_mailer/placement_summary_email.html.haml b/app/views/subscription_mailer/placement_summary_email.html.haml index 4cdefdffe1..ed53f341a1 100644 --- a/app/views/subscription_mailer/placement_summary_email.html.haml +++ b/app/views/subscription_mailer/placement_summary_email.html.haml @@ -20,4 +20,3 @@ %p   = render 'shared/mailers/signoff' -= render 'shared/mailers/powered_by' diff --git a/config/locales/en.yml b/config/locales/en.yml index f1041c92bb..7e0a4a5768 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -360,6 +360,10 @@ en: report_failed: | This report failed. It may be too big to process. We will look into it but please let us know if the problem persists. + layouts: + mailer: + open_food_network: "Open Food Network" + powered_html: "This service is powered by the %{open_food_network}." enterprise_mailer: confirmation_instructions: subject: "Please confirm the email address for %{enterprise}" @@ -2073,11 +2077,6 @@ en: show_closed_shops: "Show closed shops" hide_closed_shops: "Hide closed shops" show_on_map: "Show all on the map" - shared: - mailers: - powered_by: - open_food_network: "Open Food Network" - powered_html: "Your shopping experience is powered by the %{open_food_network}." menu: cart: cart: "Cart" diff --git a/public/map_icons/social-logos/x999.png b/public/map_icons/social-logos/x999.png new file mode 100644 index 0000000000..cbe9d15b22 Binary files /dev/null and b/public/map_icons/social-logos/x999.png differ