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
This is all baked into the way that action mailer does emails. It needs a layout with the same mimetype or action view doesn't know how to render the view.
Since maildown generates two different email bodies, it wouldn't know how to only use the html or the text layout.
You can dig in and try to add this functionality, but honestly this whole library is a giant hack.
I found a workaround, renaming general_mailer.md.erb to general_mailer.erb works for all formats.
Actually the layout formats is decided by template formats.
Ex: if rendered template is welcome.html.erb, ActiveMailer will look for html layout, if template is welcome.md.erb, ActiveMailer will look for md layout.
So layout general_mailer.erb can match for all format.
Ex:
Run UserMailer.welcome(1).deliver will not render the layout at all. But layout file general_mailer.html.erb does exist.
When I debug into the source, I find on this line https://github.com/rails/rails/blob/master/actionview/lib/action_view/renderer/template_renderer.rb#L86 it raise ActionView::MissingTemplate, but return true on https://github.com/rails/rails/blob/master/actionview/lib/action_view/renderer/template_renderer.rb#L90.
So it only search for md format layout. I don't know why it happens.
The text was updated successfully, but these errors were encountered: