From 9f77eafad71687a36724148aa517a78f958349d4 Mon Sep 17 00:00:00 2001 From: Dan Schultzer <1254724+danschultzer@users.noreply.github.com> Date: Wed, 3 Apr 2024 05:14:13 -0700 Subject: [PATCH] Update mail layout deprecation instructions --- CHANGELOG.md | 2 ++ lib/pow/phoenix/mailer/mail.ex | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3595049..a6f334ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/pow/phoenix/mailer/mail.ex b/lib/pow/phoenix/mailer/mail.ex index 1cb7d767..824965f2 100644 --- a/lib/pow/phoenix/mailer/mail.ex +++ b/lib/pow/phoenix/mailer/mail.ex @@ -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])}