Unify and improve email subjects for all emails

Some subjects had a prefix (e.g. [Instance]), some subjects were misleading (e.g. failed payment email had 'Order Confirmation', some can be clearer by adding information like order number, distributor or coordinator
This commit is contained in:
drummer83
2024-01-30 22:01:16 +01:00
parent 678e556063
commit 778b3c3f59
12 changed files with 115 additions and 72 deletions

View File

@@ -13,7 +13,7 @@ RSpec.describe ReportMailer do
let(:blob) { ReportBlob.create_locally!("customers.csv", "report content") }
it "notifies about a report" do
expect(email.subject).to eq "Report ready"
expect(email.subject).to eq "Report ready for download"
expect(email.body).to have_content "Your report is ready for download."
end

View File

@@ -35,9 +35,9 @@ RSpec.describe Spree::ShipmentMailer do
}.not_to raise_error
end
it "includes the distributor's name in the subject" do
it "includes the order number and distributor's name in the subject" do
shipment_email = Spree::ShipmentMailer.shipped_email(shipment, delivery: true)
expect(shipment_email.subject).to include("#{distributor.name} Shipment Notification")
expect(shipment_email.subject).to include("Shipment notification of order #{shipment.order.number} at #{distributor.name}")
end
it "includes the distributor's name in the body" do
@@ -52,6 +52,6 @@ RSpec.describe Spree::ShipmentMailer do
it "picked_up email has different subject" do
shipment_email = Spree::ShipmentMailer.shipped_email(shipment, delivery: false)
expect(shipment_email.subject).to include("#{distributor.name} Pick up Notification")
expect(shipment_email.subject).to include("Pick up notification of order #{shipment.order.number} at #{distributor.name}")
end
end

View File

@@ -46,7 +46,7 @@ RSpec.describe Spree::UserMailer do
email.deliver_now
expect(ActionMailer::Base.deliveries.first.subject).to include(
"Please confirm your OFN account"
"Please confirm your account on OFN Demo Site"
)
end
end