Skip to content

Commit

Permalink
Update mail layout deprecation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
danschultzer committed Apr 3, 2024
1 parent 52368f6 commit 9f77eaf
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 9f77eaf

Please sign in to comment.