0

I know this is probably an odd request, but I have an app that I am building (Rails 7) and it's very email heavy. When I visit the default mailer preview; in my case /rails/mailers/team, I'd like to have the mailers listed in a particular order. In addition to their be lots of emails, they are chronological, and it would help with QA if I could list them in a particular order on the preview page. Currently, they are alphabetical. Is there any way to change this?

Mark Locklear
  • 5,044
  • 1
  • 51
  • 81

1 Answers1

0

I don't think there is a way to change the order of the mailers in the preview page. However, you can change the order of the previews in the mailer preview class. For example, if you have a mailer called UserMailer, you can change the order of the previews in the UserMailerPreview class. For example:

class UserMailerPreview < ActionMailer::Preview
  def welcome
    UserMailer.welcome(User.first)
  end

  def goodbye
    UserMailer.goodbye(User.first)
  end
end
Tibic4
  • 3,709
  • 1
  • 13