Skip to content

Commit

Permalink
Merge pull request #730 from pow-auth/update-mail-layout-deprecation
Browse files Browse the repository at this point in the history
Update mail layout deprecation instructions
  • Loading branch information
danschultzer authored Apr 3, 2024
2 parents 52368f6 + 9f77eaf commit 4245b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ Removed deprecation warnings for Elixir 1.15.

This version is updated to work with Phoenix 1.7, in particular using the new template components structure. All views have been removed, and Pow no longer requires the `phoenix_view` dependency.

Instead of `pow_mailer_layout: {MyAppWeb.LayoutView, :email})` you should use `pow_mailer_layouts: [html: {MyAppWeb.Layouts, :email}, text: {MyAppWeb.Layouts, :email_text}]` in `conn.private`.

Now requires Elixir 1.12+.

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion lib/pow/phoenix/mailer/mail.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ defmodule Pow.Phoenix.Mailer.Mail do
defp handle_deprecated_layout(conn) do
case Map.has_key?(conn.private, :pow_mailer_layout) do
true ->
IO.warn("`:pow_mailer_layout` in conn.private has been deprecated, please change it to `:pow_mailer_layouts`")
IO.warn("`pow_mailer_layout: #{inspect conn.private[:pow_mailer_layout]}` in conn.private has been deprecated, please change it to `pow_mailer_layouts: [_: #{inspect conn.private[:pow_mailer_layout]}]`")

%{conn | private: Map.put(conn.private, :pow_mailer_layouts, _: conn.private[:pow_mailer_layout])}

Expand Down

0 comments on commit 4245b05

Please sign in to comment.