From ed37604bc283ffa1c8000f372c21ca1cb4b953b9 Mon Sep 17 00:00:00 2001 From: Lynne Davis Date: Sat, 18 Jun 2016 09:09:43 +0100 Subject: [PATCH 1/6] Update from address in notification emails --- app/mailers/producer_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb index 30fad48f58..bdaf25123d 100644 --- a/app/mailers/producer_mailer.rb +++ b/app/mailers/producer_mailer.rb @@ -14,7 +14,7 @@ class ProducerMailer < Spree::BaseMailer if has_orders? order_cycle, producer mail(to: @producer.email, - from: from_address, + from: @coordinator.email, subject: subject, reply_to: @coordinator.email, cc: @coordinator.email) From f37f89dd07b6132704b040be8f30d981c62f8b13 Mon Sep 17 00:00:00 2001 From: Lynne Davis Date: Mon, 20 Jun 2016 15:13:49 +0100 Subject: [PATCH 2/6] Adding Community forum to ContentConfig --- app/controllers/admin/contents_controller.rb | 4 ++-- app/models/content_configuration.rb | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index 87c86997d9..c8d04efebb 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -6,9 +6,9 @@ module Admin {name: 'Producer signup page', preferences: [:producer_signup_pricing_table_html, :producer_signup_case_studies_html, :producer_signup_detail_html]}, {name: 'Hub signup page', preferences: [:hub_signup_pricing_table_html, :hub_signup_case_studies_html, :hub_signup_detail_html]}, {name: 'Group signup page', preferences: [:group_signup_pricing_table_html, :group_signup_case_studies_html, :group_signup_detail_html]}, - {name: 'Footer', preferences: [:footer_logo, + {name: 'Footer and External Links', preferences: [:footer_logo, :footer_facebook_url, :footer_twitter_url, :footer_instagram_url, :footer_linkedin_url, :footer_googleplus_url, :footer_pinterest_url, - :footer_email, :footer_links_md, :footer_about_url, :footer_tos_url]}] + :footer_email, :community_forum_url, :footer_links_md, :footer_about_url, :footer_tos_url]}] end def update diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index e20279f5ee..fc35a2b0ba 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -34,6 +34,8 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration # Footer preference :footer_logo, :file has_attached_file :footer_logo, default_url: "/assets/ofn-logo-footer.png" + + #Other preference :footer_facebook_url, :string, default: "https://www.facebook.com/OpenFoodNet" preference :footer_twitter_url, :string, default: "https://twitter.com/OpenFoodNet" preference :footer_instagram_url, :string, default: "" @@ -41,6 +43,7 @@ class ContentConfiguration < Spree::Preferences::FileConfiguration preference :footer_googleplus_url, :string, default: "" preference :footer_pinterest_url, :string, default: "" preference :footer_email, :string, default: "hello@openfoodnetwork.org" + preference :community_forum_url, :string, default: "http://community.openfoodnetwork.org" preference :footer_links_md, :text, default: <<-EOS [Newsletter sign-up](/) From 98548e15c55485ea509769288edccc4c731017dc Mon Sep 17 00:00:00 2001 From: Lynne Davis Date: Mon, 20 Jun 2016 15:18:25 +0100 Subject: [PATCH 3/6] I18n of enterprise emails --- app/views/enterprise_mailer/welcome.html.haml | 2 +- .../spree/user_mailer/signup_confirmation.html.haml | 4 +--- config/locales/en.yml | 9 +++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/enterprise_mailer/welcome.html.haml b/app/views/enterprise_mailer/welcome.html.haml index 97b350de45..a5d6f20823 100644 --- a/app/views/enterprise_mailer/welcome.html.haml +++ b/app/views/enterprise_mailer/welcome.html.haml @@ -13,7 +13,7 @@ = t :email_admin_html, link: link_to('Admin Panel', spree.admin_url) %p - = t :email_community_html, link: link_to('Join the community.', 'http://community.openfoodnetwork.org/') + = t :email_community_html, link: link_to(t(:join_the_community), #{ ContentConfig.community_forum_url }) %p = t :email_help diff --git a/app/views/spree/user_mailer/signup_confirmation.html.haml b/app/views/spree/user_mailer/signup_confirmation.html.haml index e45b99a000..fe55de9a40 100644 --- a/app/views/spree/user_mailer/signup_confirmation.html.haml +++ b/app/views/spree/user_mailer/signup_confirmation.html.haml @@ -21,9 +21,7 @@ %p.lead = t :email_signup_text %p - = t :email_signup_help_html - %a{:href => "mailto:hello@openfoodnetwork.org", :target => "_blank"} - hello@openfoodnetwork.org + = t :email_signup_help_html, email: mail_to(ContentConfig.footer_email, ContentConfig.footer_email) = render 'shared/mailers/signoff' diff --git a/config/locales/en.yml b/config/locales/en.yml index 7fd49fc2fe..71e2a5df2a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -237,7 +237,7 @@ en: address: Address address2: Address (contd.) city: City - state: State + state: County postcode: Postcode country: Country unauthorized: Unauthorized @@ -400,6 +400,7 @@ en: email_admin_html: "You can manage your account by logging into the %{link} or by clicking on the cog in the top right hand side of the homepage, and selecting Administration." email_community_html: "We also have an online forum for community discussion related to OFN software and the unique challenges of running a food enterprise. You are encouraged to join in. We are constantly evolving and your input into this forum will shape what happens next. %{link}" + join_community: "Join the community" email_help: "If you have any difficulties, check out our FAQs, browse the forum or post a 'Support' topic and someone will help you out!" email_confirmation_greeting: "Hi, %{contact}!" email_confirmation_profile_created: "A profile for %{name} has been successfully created! @@ -447,7 +448,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using email_signup_text: "Thanks for joining the network. If you are a customer, we look forward to introducing you to many fantastic farmers, wonderful food hubs and delicious food! If you are a producer or food enterprise, we are excited to have you as a part of the network." - email_signup_help_html: "We welcome all your questions and feedback; you can use the Send Feedback button on the site or email us at" + email_signup_help_html: "We welcome all your questions and feedback; you can use the Send Feedback button on the site or email us at %{email}" producer_mail_greeting: "Dear" producer_mail_text_before: "We now have all the consumer orders for the next food drop." @@ -820,8 +821,8 @@ Please follow the instructions there to make your enterprise visible on the Open registration_detail_postcode: "Postcode:" registration_detail_postcode_placeholder: "e.g. 3070" registration_detail_postcode_error: "Postcode required" - registration_detail_state: "State:" - registration_detail_state_error: "State required" + registration_detail_state: "County:" + registration_detail_state_error: "County required" registration_detail_country: "Country:" registration_detail_country_error: "Please select a country" fees: "Fees" From 99d22649a2307b2a5a0ab21d57fd06e42f97d2ef Mon Sep 17 00:00:00 2001 From: Lynne Davis Date: Mon, 20 Jun 2016 15:21:34 +0100 Subject: [PATCH 4/6] Undoing this change, shouldn't be on this branch --- app/mailers/producer_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb index bdaf25123d..30fad48f58 100644 --- a/app/mailers/producer_mailer.rb +++ b/app/mailers/producer_mailer.rb @@ -14,7 +14,7 @@ class ProducerMailer < Spree::BaseMailer if has_orders? order_cycle, producer mail(to: @producer.email, - from: @coordinator.email, + from: from_address, subject: subject, reply_to: @coordinator.email, cc: @coordinator.email) From 5b22e19ec9e29e100826b1bddad14907d6a09a1c Mon Sep 17 00:00:00 2001 From: Lynne Davis Date: Mon, 20 Jun 2016 15:24:24 +0100 Subject: [PATCH 5/6] Undoing locale changes accidentally committed --- config/locales/en.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 71e2a5df2a..44aa36e58f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -237,7 +237,7 @@ en: address: Address address2: Address (contd.) city: City - state: County + state: State postcode: Postcode country: Country unauthorized: Unauthorized @@ -821,8 +821,8 @@ Please follow the instructions there to make your enterprise visible on the Open registration_detail_postcode: "Postcode:" registration_detail_postcode_placeholder: "e.g. 3070" registration_detail_postcode_error: "Postcode required" - registration_detail_state: "County:" - registration_detail_state_error: "County required" + registration_detail_state: "State:" + registration_detail_state_error: "State required" registration_detail_country: "Country:" registration_detail_country_error: "Please select a country" fees: "Fees" From 02d8f524261e731778a7f3a09ad8c30e8d3b1cd4 Mon Sep 17 00:00:00 2001 From: Lynne Davis Date: Mon, 20 Jun 2016 17:02:10 +0100 Subject: [PATCH 6/6] Fixing syntax --- app/views/enterprise_mailer/welcome.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/enterprise_mailer/welcome.html.haml b/app/views/enterprise_mailer/welcome.html.haml index a5d6f20823..5f55b51709 100644 --- a/app/views/enterprise_mailer/welcome.html.haml +++ b/app/views/enterprise_mailer/welcome.html.haml @@ -13,7 +13,7 @@ = t :email_admin_html, link: link_to('Admin Panel', spree.admin_url) %p - = t :email_community_html, link: link_to(t(:join_the_community), #{ ContentConfig.community_forum_url }) + = t :email_community_html, link: link_to("t(:join_the_community)", "#{ ContentConfig.community_forum_url }") %p = t :email_help