-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support for Phoenix 1.7 #7
Comments
It is also worth noting that there is some good debate going on here: swoosh/phoenix_swoosh#287 |
We have a working branch in our fork: https://github.com/populimited/bamboo_phoenix We've implemented support for Phoenix 1.7 and components as your 2.a point by conforming usage of Phoenix.Component An example of how components should be implemented, using defmodule PhoenixLayouts do
use Phoenix.Component
embed_templates "support/templates/phoenix_layout/*.html", suffix: "_html"
embed_templates "support/templates/phoenix_layout/*.text", suffix: "_text"
end
defmodule EmailHTML do
use Phoenix.Component
embed_templates "support/templates/email/*.html", suffix: "_html"
embed_templates "support/templates/email/*.text", suffix: "_text"
def function_in_view do
"function used in Bamboo.TemplateTest but needed because template is compiled"
end
end
defmodule Email do
use Bamboo.Phoenix, component: EmailHTML
def text_and_html_email_with_layout do
new_email()
|> put_layout({PhoenixLayouts, :app})
|> render(:text_and_html_email)
end
def html_email_with_layout do
new_email()
|> put_html_layout({PhoenixLayouts, "app_html"})
|> render("html_email_html")
end
end |
@icr4 I see the PR was closed; was that on purpose? |
Yes since it is not production ready yet, docs and backward compatibility should be further improved |
With Phoenix 1.7 replacing
Phoenix.View
withPhoenix.Component
(see docs in:phoenix_view
),bamboo_phoenix
will need to be updated. This update will likely need to involve a few steps:1.0.1
)2.0.0
) that either:a. Conforms to the updated usage of
Phoenix.Component
b. Includes
:phoenix_view
as a direct dependency so thatPhoenix.View.render_to_string/3
can still be calledIMO 2a is the path that should be taken but I'd appreciate a maintainer's input before heading down a particular path.
The text was updated successfully, but these errors were encountered: