From 1770cbb6bf6b0d326fa96bc055cbcf61749a2d19 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 26 Feb 2016 16:09:14 +1100 Subject: [PATCH] Display footer_email in confirmation emails correctly A bug introduced in a9c37c162e1956028704fbdf74ce1c56c5b3ce7d caused the creation of confirmation emails for shops to fail. The email template got fixed now and the email address from the database is displayed if present. --- app/views/shared/mailers/_social_and_contact.html.haml | 3 +-- spec/mailers/order_mailer_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/shared/mailers/_social_and_contact.html.haml b/app/views/shared/mailers/_social_and_contact.html.haml index 4f5222f77d..d76925c641 100644 --- a/app/views/shared/mailers/_social_and_contact.html.haml +++ b/app/views/shared/mailers/_social_and_contact.html.haml @@ -24,6 +24,5 @@ %h5 = t :email_contact %strong - %a{href: ContentConfig.footer_email.reverse, mailto: true, target: '_blank'} - #{ContentConfig.footer_email} + = mail_to ContentConfig.footer_email %span.clear diff --git a/spec/mailers/order_mailer_spec.rb b/spec/mailers/order_mailer_spec.rb index a472e95979..6e88742fe7 100644 --- a/spec/mailers/order_mailer_spec.rb +++ b/spec/mailers/order_mailer_spec.rb @@ -40,5 +40,12 @@ describe Spree::OrderMailer do ActionMailer::Base.deliveries.count.should == 1 ActionMailer::Base.deliveries.first.to.should == [@distributor.email] end + + it "sends an email even if a footer_email is given" do + # Testing bug introduced by a9c37c162e1956028704fbdf74ce1c56c5b3ce7d + ContentConfig.footer_email = "email@example.com" + Spree::OrderMailer.confirm_email_for_shop(@order1.id).deliver + ActionMailer::Base.deliveries.count.should == 1 + end end end