Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect html and text render in mailer fallback #701

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.0.31 (TBA)

## Bug fixes

- [`Pow.Phoenix.Mailer.Mail`] Now renders html and text correctly in fallback mode for deprecated MailView

## v1.0.30 (2023-04-28)

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions lib/pow/phoenix/mailer/mail.ex
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ defmodule Pow.Phoenix.Mailer.Mail do
defp fallback_render(module, template, assigns, layouts) do
%Template{
subject: module.subject(template, assigns),
html: Phoenix.Template.render_to_string(module, to_string(template), "text", put_layout(assigns, layouts, :text)),
text: Phoenix.Template.render_to_string(module, to_string(template), "html", put_layout(assigns, layouts, :html))
text: Phoenix.Template.render_to_string(module, to_string(template), "text", put_layout(assigns, layouts, :text)),
html: Phoenix.Template.render_to_string(module, to_string(template), "html", put_layout(assigns, layouts, :html))
}
end

Expand Down