# Strange problem about mailer - no template found

**URL:** <https://www.ruby-forum.com/t/strange-problem-about-mailer-no-template-found/114055>\
**Category:** Rails\
**Created:** [September 7, 2007, 11:50am UTC](https://www.ruby-forum.com/t/strange-problem-about-mailer-no-template-found/114055 "2007-09-07T11:50:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cafebabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@cafebabe](https://www.ruby-forum.com/u/cafebabe)\
**Post date:** [September 7, 2007, 11:50am UTC](https://www.ruby-forum.com/t/strange-problem-about-mailer-no-template-found/114055/1 "2007-09-07T11:50:31Z")

</div>

send mail in console, failed for the first time, but successfully sent  
after reloading…, following are my code snippet:

class Mailer \< ActionMailer::Base  
def notification()  
…  
end  
end

class Model \< ActiveRecord::Base  
def self.send\_notifications  
mail=Mailer.create\_notification()  
mail.set\_content\_type(‘text/html;charset=utf-8’)  
Mailer.deliver(mail)  
end  
end

1 script/console

2 Model.send\_notifitions  
#failed  
ActionView::ActionViewError: No rhtml, rxml, rjs or delegate template  
found for notifications in /mailer  
from  
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action\_view/base.rb:399:in  
`find_template_extension_for' from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:335:in`pick\_template\_extension’  
from  
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action\_view/base.rb:249:in  
`render_file' from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:283:in`render’  
from  
/opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action\_mailer/base.rb:481:in  
`render' from /opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/base.rb:476:in`render\_message’  
from  
/opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action\_mailer/base.rb:424:in  
`create!' from /opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/base.rb:385:in`initialize’  
from  
/opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action\_mailer/base.rb:332:in  
`new' from /opt/local/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mailer/base.rb:332:in`method\_missing’  
from ./script/…/config/…/config/…/app/models/model.rb:200:in  
`send\_notifications’

3 reload!  
#ok

4 Model.send\_notifitions  
#sent successfully

how strange, anybody knows? thanks

---

<div class="post-metadata">

**Author:** ![cafebabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@cafebabe](https://www.ruby-forum.com/u/cafebabe)\
**Post date:** [September 7, 2007, 11:54am UTC](https://www.ruby-forum.com/t/strange-problem-about-mailer-no-template-found/114055/2 "2007-09-07T11:54:46Z")

</div>

sorry, the error stack is

ActionView::ActionViewError: No rhtml, rxml, rjs or delegate template  
found for notification in /mailer  
…

notification.rhtml does exits in /mailer. anyone knows? thanks a lot.

---

<div class="post-metadata">

**Author:** ![cafebabe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@cafebabe](https://www.ruby-forum.com/u/cafebabe)\
**Post date:** [September 7, 2007, 11:59am UTC](https://www.ruby-forum.com/t/strange-problem-about-mailer-no-template-found/114055/3 "2007-09-07T11:59:37Z")

</div>

and my rails version is 1.2.3, system is macos…
