After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help?
Added by Chaoqun Zou over 15 years ago
I have test two plugins(ezfaq_plugin, system_notification), all of them will get the exception as below.
Can anyone help to figure out where the problem is?
Template is missing
Missing template system_notification_mailer/system_notification.erb in view path D:/ruby/workspace/redmine/vendor/plugins/system_notification/app/views:D:/ruby/workspace/redmine/vendor/plugins/redmine_ezlibrarian/app/views:D:/ruby/workspace/redmine/vendor/plugins/redmine_ezftpsearch/app/views:D:/ruby/workspace/redmine/vendor/plugins/ezfaq_plugin/app/views:D:/ruby/workspace/redmine/app/views:D:/ruby/workspace/redmine/app/views:
Replies (7)
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Mischa The Evil over 15 years ago
Chaoqun Zou wrote:
Can anyone help to figure out where the problem is?
This is due to the merge of the Rails 2.2 branch with r2493. With that revision r1723 (which is the change to the Engines-plugin which brings the ability of overriding the view-layer of the core) got lost. You could see #2841 for the report of the bug...
Currently: this bug has been fixed already (by reimplementing r1723) in r2525.
HTH...
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Eric Davis over 15 years ago
Mischa,
I don't think r2525 resolved it. For some reason any ActionMailer model in a plugin is looking for name.erb
and not the standard name.text.html.erb
or name.text.html.rhtml
files. I'll be researching it soon, it affect a few of my plugins.
Eric
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Eric Davis over 15 years ago
I was able to fix this on my Questions plugin. Rails 2.2.2 changed the way it looks for plain text templates.
https://projects.littlestreamsoftware.com/issues/2209
Eric
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Chaoqun Zou over 15 years ago
Hi, Eric
I have found that the new mailer method will add the plain-text mail to the mail's attachment, while the original redmine's mail doesn't contain attachment. Wondering if we can correct this?
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Chaoqun Zou over 15 years ago
Hi, Eric
I have checked your new system notification plugin, and it have solved the attachment problem wonderfully!
But now I have found another defect in the notify email: the html part of the email lost the css style so that the html email can't be showed perfectly.
Any ideas?
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Eric Davis over 15 years ago
Chaoqun Zou wrote:
I have checked your new system notification plugin, and it have solved the attachment problem wonderfully!
Yea, lets just say ActionMailer and I have had a few late nights recently. :(
But now I have found another defect in the notify email: the html part of the email lost the css style so that the html email can't be showed perfectly.
In my plugins or yours? I remember seeing the CSS in the development mail but I haven't deployed the latest code yet so I don't have any real world use yet.
Eric
RE: After updated to redmine devel(about r2520), the mailer under plugin will get a template missing exception. Can anyone help? - Added by Chaoqun Zou over 15 years ago
Eric Davis wrote:
In my plugins or yours? I remember seeing the CSS in the development mail but I haven't deployed the latest code yet so I don't have any real world use yet.
Yes, both of them. And I have found that is because the html view file's extension has been set to erb(not rhtml).
Check redmine's mailer model, it requires the html view file must end with rhtml or rxml:
# Renders a message with the corresponding layout
def render_message(method_name, body)
layout = method_name.to_s.match(%r{text\.html\.(rhtml|rxml)}) ? 'layout.text.html.rhtml' : 'layout.text.plain.rhtml'
body[:content_for_layout] = render(:file => method_name, :body => body)
ActionView::Base.new(template_root, body, self).render(:file => "mailer/#{layout}", :use_full_path => true)
end