You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmodule MyApp.Notifications.Views.EmailView do
use Bamboo.View, path: "lib/my_app/notifications/templates"
end
So I'm sending Emails from the context because I need to send them from a background job and so getting MyAppView involved didn't make sense to me. Anyhoo, the emails are sent from another module defined like:
defmodule MyApp.Notifications do
use Bamboo.Template, view: MyApp.Notifications.Views.EmailView
def reset_password_email(user) do
...
base_email()
|> to(email)
|> subject("Forgot password")
|> assign(:user, user)
|> put_text_layout({EmailView, "reset_password.text"})
|> put_html_layout({EmailView, "reset_password.html"})
|> render(:reset_password)
|> Mailer.deliver_later()
...
end
When working with this reset feature I was getting this error:
The reason it is showing reset.html and reset.text is because that was the working configuration before I changed it in the 1) filename, 2) put_html_layout, put_text_layout, and 3) render. So I changed all of these three to reset_password and I got the template not found error. It wasn't compiling until I ran mix clean and mix compile. Then it worked fine.
Not sure if this is an error on my part but thought it would be good to raise this observation.
(Thank you for maintaining this library!)
The text was updated successfully, but these errors were encountered:
Hi @AdamT, thank you for opening this issue. I think that is working as expected (we're compiling the templates), but I'll try to look a little more into it to see if there's something better we can do here.
I have non-traditional setup if I had to guess.
The EmailView looks like this:
So I'm sending Emails from the context because I need to send them from a background job and so getting MyAppView involved didn't make sense to me. Anyhoo, the emails are sent from another module defined like:
When working with this reset feature I was getting this error:
The reason it is showing
reset.html
andreset.text
is because that was the working configuration before I changed it in the 1) filename, 2) put_html_layout, put_text_layout, and 3) render. So I changed all of these three toreset_password
and I got the template not found error. It wasn't compiling until I ranmix clean
andmix compile
. Then it worked fine.Not sure if this is an error on my part but thought it would be good to raise this observation.
(Thank you for maintaining this library!)
The text was updated successfully, but these errors were encountered: