Closed isaacfreeman closed 11 years ago
Thanks Isaac,
I have questions :innocent:
We should check all active themes, but there's no default theme. If no theme has a layout for the email, we should get a relative path that matches a subdirectory in views.
For example, in Breeze Commerce, I have default templates in
breeze_commerce/app/views/breeze/commerce/order_mailer/
If I want the template "new_order_merchant_notification.html.haml", I call
template_path('breeze/commerce/order_mailer/new_order_merchant_notification')
...so I'll either get a template path
<theme.path>/mail_templates/breeze/commerce/order_mailer/new_order_merchant_notification
or, if there's no theme template, from
/breeze/commerce/order_mailer/new_order_merchant_notification
the latter should match any engine that declares the template, or the parent app, so developers can hard-code a template if they prefer not to make it available in a theme.
I think this behaviour is fairly consistent with how Breeze works for other theme files.
I note that I've neglected a couple of things:
Quite possibly. I'd like to press on with other work right now, so perhaps we can open an issue for this.
That makes sense. The only reason theme_path and template_path are separate methods is that I wasn't certain that theme_path belonged in Breeze::Mailer.
fixes #99