Skip to content

Commit

Permalink
Merge pull request #3607 from coorasse/patch-2
Browse files Browse the repository at this point in the history
Fix error message on email preview
  • Loading branch information
spaghetticode authored May 8, 2020
2 parents 28095d5 + 1179d46 commit 354e249
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/lib/spree/mailer_previews/carton_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class MailerPreviews
class CartonPreview < ActionMailer::Preview
def shipped
carton = Carton.joins(:orders).last
raise "Your database needs at one shipped order with a carton to render this preview" unless carton
raise "Your database needs at least one shipped order with a carton to render this preview" unless carton

Spree::Config.carton_shipped_email_class.shipped_email(order: carton.orders.first, carton: carton)
end
end
Expand Down

0 comments on commit 354e249

Please sign in to comment.