Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Remove TestMailer and emails.rake (#13689)
Damian Legawiec7f648315c3bc
diff --git a/spree/core/app/mailers/spree/test_mailer.rb b/spree/core/app/mailers/spree/test_mailer.rbdeleted file mode 100644index a12017ac80..0000000000--- a/spree/core/app/mailers/spree/test_mailer.rb+++ /dev/null@@ -1,8 +0,0 @@-module Spree- class TestMailer < BaseMailer- def test_email(email)- subject = "#{Spree::Store.default.name} #{Spree.t('test_mailer.test_email.subject')}"- mail(to: email, from: from_address, reply_to: reply_to_address, subject: subject)- end- end-enddiff --git a/spree/core/app/views/spree/test_mailer/test_email.html.erb b/spree/core/app/views/spree/test_mailer/test_email.html.erbdeleted file mode 100644index 227b6b7195..0000000000--- a/spree/core/app/views/spree/test_mailer/test_email.html.erb+++ /dev/null@@ -1,40 +0,0 @@-<table>- <tr>- <td>-- <center>- <h1 class="center">- <%= Spree.t('test_mailer.test_email.greeting') %>- </h1>- </center>-- </td>- <td class="expander"></td>- </tr>-</table>--<table>- <tr>- <td>-- <p class="lede">- <%= Spree.t('test_mailer.test_email.message') %>- </p>-- <p>- Please remember to configure all of the emails that Spree has provided to your needs.- Spree comes shipped with <a href="http://zurb.com/ink/" target="_blank"> Ink </a>- prepackaged, but you can use your own version. Ink is not placed in the asset pipeline.- </p>-- <p>- Also take note that Gmail does not support <code><style></code> tags.- Therefore, you will need a gem that will be able to remove your <code><style></code>- tags and place them inline. Gmail only supports inline styles. We use- <a href="https://github.com/fphilipe/premailer-rails" target="_blank">Premailer for Rails</a> by default.- </p>-- </td>- <td class="expander"></td>- </tr>-</table>diff --git a/spree/core/app/views/spree/test_mailer/test_email.text.erb b/spree/core/app/views/spree/test_mailer/test_email.text.erbdeleted file mode 100644index 3491d6fbf3..0000000000--- a/spree/core/app/views/spree/test_mailer/test_email.text.erb+++ /dev/null@@ -1,4 +0,0 @@-<%= Spree.t('test_mailer.test_email.greeting') %>-================--<%= Spree.t('test_mailer.test_email.message') %>diff --git a/spree/core/config/locales/en.yml b/spree/core/config/locales/en.ymlindex d56023446c..48a22fcc6e 100644--- a/spree/core/config/locales/en.yml+++ b/spree/core/config/locales/en.yml@@ -2312,11 +2312,6 @@ en:taxons: Taxonsterms_of_service: Terms of Servicetest: Test- test_mailer:- test_email:- greeting: Congratulations!- message: If you have received this email, then your email settings are correct.- subject: Test Mailtest_mode: Test Modetext_alignment: Text alignmentthank_you_for_your_order: Thank you for your business. Please print out a copy of this confirmation page for your records.diff --git a/spree/emails/lib/tasks/email.rake b/spree/emails/lib/tasks/email.rakedeleted file mode 100644index 87f1fc8dcd..0000000000--- a/spree/emails/lib/tasks/email.rake+++ /dev/null@@ -1,10 +0,0 @@-namespace :email do- desc 'Sends test email to specified address - Example: [email protected] bundle exec rake email:test'- task test: :environment do- unless ENV['EMAIL'].present?- raise ArgumentError, 'Must pass EMAIL environment variable. ' \- 'Example: [email protected] bundle exec rake email:test'- end- Spree::TestMailer.test_email(ENV['EMAIL']).deliver_now- end-enddiff --git a/spree/emails/spec/mailers/spree/test_mailer_spec.rb b/spree/emails/spec/mailers/spree/test_mailer_spec.rbdeleted file mode 100644index ccfe573f5e..0000000000--- a/spree/emails/spec/mailers/spree/test_mailer_spec.rb+++ /dev/null@@ -1,22 +0,0 @@-require 'spec_helper'-require 'email_spec'--describe Spree::TestMailer, type: :mailer do- include EmailSpec::Helpers- include EmailSpec::Matchers-- let(:user) { create(:user) }-- context ':from not set explicitly' do- it 'falls back to spree config' do- message = Spree::TestMailer.test_email('[email protected]')- expect(message.from).to eq([@default_store.mail_from_address])- end- end-- it 'confirm_email accepts a user id as an alternative to a User object' do- expect do- Spree::TestMailer.test_email('[email protected]')- end.not_to raise_error- end-end