Skip to content

v0.2.0-alpha.2

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 05 Sep 19:05
· 20 commits to main since this release
2d188b2

Added

  • Phlex views for hanami-mailer. A mailer renders the Phlex class whose container key matches its own, so
    MyApp::Mailers::Welcome renders MyApp::Views::Mailers::Welcome with no configuration.
  • Phlex::Hanami::Mailer::View and Phlex::Hanami::Mailer::Layout, and Phlex::Hanami::Mailer::Renderable for an
    existing Phlex::HTML base class.
  • A plain text alternative part, converted from the rendered HTML by Phlex::Hanami::Mailer::Text. Override
    text_body on the view to write it by hand.
  • A mail layout convention: Views::Mailers::Layout in a slice wraps that slice's mail views.
  • Usage documentation under docs/usage, covering views, layouts, the view context,
    helpers, mailers and how the gem hooks into Hanami.
  • Phlex::Hanami::MailerViewError, raised when a mailer is paired with a Phlex view that is not a mail view,
    rather than sending a message whose plain text part is markup.

Changed

  • url in a view returns a String. Hanami's routes helper returns a URI, which Phlex rejects as an attribute
    value, so a(href: url(:posts)) raised.

Fixed

  • path in a mail view raises Phlex::Hanami::RelativePathError instead of writing a relative link an email client
    cannot follow.