ActionMailer Preview. Is it posible to use multiple paths?

Hi there!

In my project I have a few engines. Each engine has its own set of Mailers and templates.

I want to have Previews for each specific engine, and keep them in engines.

I’ve found that ActionMailer Preview provides a way to change a path to preview classes, but looks like it’s impossible to use an array of paths, or use something like prepand_view_path / append_view_path like we can do in controllers.

https://github.com/rails/rails/blob/3faf7485623da55215d6d7f3dcb2eed92c59c699/actionmailer/lib/action_mailer/preview.rb#L92

Is there any way to have multiple paths for ActionMailer Preview?

Is it possible to create some kind of monkey patch to implement it?

Thanks!

I’ve run into this same issue myself. It looks like work started on this feature but bogged down. See Add support for multiple preview_path by camelmasa · Pull Request #16836 · rails/rails · GitHub

Would be great to get that pull request fixed up and merged in!