diff --git a/lib/chili/enterprises_distributor_info_rich_text_feature/app/helpers/feature_helper.rb b/app/helpers/html_helper.rb similarity index 81% rename from lib/chili/enterprises_distributor_info_rich_text_feature/app/helpers/feature_helper.rb rename to app/helpers/html_helper.rb index af6b246ec8..85dc5b1c53 100644 --- a/lib/chili/enterprises_distributor_info_rich_text_feature/app/helpers/feature_helper.rb +++ b/app/helpers/html_helper.rb @@ -1,4 +1,4 @@ -module FeatureHelper +module HtmlHelper def strip_html(html) strip_tags(html).gsub(/ /i, ' ').gsub(/&/i, '&') end diff --git a/app/mailers/spree/order_mailer_decorator.rb b/app/mailers/spree/order_mailer_decorator.rb new file mode 100644 index 0000000000..1ce563ad56 --- /dev/null +++ b/app/mailers/spree/order_mailer_decorator.rb @@ -0,0 +1,3 @@ +Spree::OrderMailer.class_eval do + helper HtmlHelper +end diff --git a/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb b/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb index 8ad201729d..8adedd90ec 100644 --- a/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb +++ b/lib/chili/enterprises_distributor_info_rich_text_feature/lib/enterprises_distributor_info_rich_text_feature/engine.rb @@ -7,8 +7,6 @@ module EnterprisesDistributorInfoRichTextFeature initializer 'enterprises_distributor_info_rich_text_feature.mailer', :after => :load_config_initializers do |app| if OpenFoodWeb::FeatureToggle.enabled? :enterprises_distributor_info_rich_text ::Spree::OrderMailer.class_eval do - helper FeatureHelper - def confirm_email(order, resend = false) @order = order subject = (resend ? "[#{t(:resend).upcase}] " : '')