Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEA: Support for Mailer Previews #570

Open
drush opened this issue Dec 19, 2023 · 1 comment
Open

FEA: Support for Mailer Previews #570

drush opened this issue Dec 19, 2023 · 1 comment
Labels
feature request A suggestion for a feature or enhancement

Comments

@drush
Copy link

drush commented Dec 19, 2023

Lookbook is a better, modern preview implementation for Rails applications. While it handles Pages and Components out-of-the-box, it does not currently include support for Mailers. Mailers and Mailer Previews share almost identical semantics to Components for developers in view/develop/test workflows.

This feature request is to add support for Mailer Previews as a first-order feature of Lookbook.

Developers have many options for Mailer Previews including built-in /rails/mailers/ preview route, Maily, letter_opener, but removing these dependencies for unified previews through Lookbook is beneficial from a code complexity and security standpoint. The UI for Lookbook also offers a modern, rapid workflow.

PROPOSED

  • Lookbook to detect classes inherited from ActionMailer::Preview automatically to add to the component menu
  • Use a view wrapper for mailer previews to add space for meta headers (to, from, subject, etc) and allow for the mailer to be self-contained HTML (rather than using a shared layout)

REFERENCE

@drush drush added the feature request A suggestion for a feature or enhancement label Dec 19, 2023
@allmarkedup
Copy link
Collaborator

Hey @drush, I'm so sorry for the ridiculously slow reply.

I have to say that I love this idea. It certainly feels like a good fit for Lookbook and would be a really nice feature.

I have personally never worked with mailer previews but I believe some of the original design of the native ViewComponent preview system was inspired by the way that they work. And the article you've linked to shows it's definitely possible so I don't think supporting these kind of previews would be too much of a stretch.

Unfortunately I have very little spare time at the moment to implement new features but I will keep this in mind for when I next get a chance to do some more work on Lookbook. If I get a first pass together I'll let you know so you can kick the tyres on it a bit :)

Thanks again for the suggestion and apologies again for being so slow to get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A suggestion for a feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants