Roda Mailer Preview
Easily preview your emails inside your application under a customizable route.
If you've ever used the
mail_view gem for Rails, or in recent Rails versions,
the ability to preview an email, this is very similar to that.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install roda-mailer_preview
Aside from configuring the Roda mailer plugin as you normally would, routes to preview the emails
is required, ensuring that the
preview_index methods are called with an instance of
class App < Roda plugin :mailer_preview route do |r| r.on "mail_view" do # Preview /the-mailer at /mail_view/test r.is "test" do mail = YourMailer.mail("/the-mailer") preview(mail) end # Provides an index of all previewable-mailers at /mail_view r.is true do mailers = ["/test"] preview_index(mailers) end end end end
This library doesn't currently support HTML views. I'd likely accept a pull request if you wanted to submit one.
Bug reports and pull requests are welcome on GitHub at https://github.com/adam12/roda-mailer_preview.
I love pull requests! If you fork this project and modify it, please ping me to see if your changes can be incorporated back into this project.
That said, if your feature idea is nontrivial, you should probably open an issue to discuss it before attempting a pull request.
The gem is available as open source under the terms of the MIT License.
I was shamelessly inspired by the CSS of the MailView gem.