# Actionmailer and mailer\_name

**URL:** <https://www.ruby-forum.com/t/actionmailer-and-mailer-name/128540>\
**Category:** Rails\
**Created:** [February 8, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/actionmailer-and-mailer-name/128540 "2008-02-08T16:07:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [February 8, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/actionmailer-and-mailer-name/128540/1 "2008-02-08T16:07:03Z")

</div>

Dear list,

I am trying to sent mails through ActionMailer. As I have done in the  
past. However I now get this really strange message;

ActionView::ActionViewError (Due to changes in ActionMailer, you need  
to provide the mailer\_name along with the template name.

render “user\_mailer/signup”  
render :file =\> “user\_mailer/signup”

If you are rendering a subtemplate, you must now use controller-like  
partial syntax:

render :partial =\> ‘signup’ # no mailer\_name necessary  
):

So I did what anyone would do;  
mailer\_name(“contact”) #the name of my ActionMailer class.  
That did not work. Neither did;  
render “contact/contact”  
or;  
render :file =\> “contact/contact”

I am a bit at a loss now. I am using the globalize plugin which  
requires me to name my templates like this:  
“contact.en.text.plain.erb”, perhaps that is causing the problem.  
Any help is greatly appreciated.

With kind regards,  
Harm

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [February 11, 2008, 12:06am UTC](https://www.ruby-forum.com/t/actionmailer-and-mailer-name/128540/2 "2008-02-11T00:06:03Z")

</div>

I am having the same problem, but am /not/ using the globalize plugin,  
so I  
don’t think the problem lies there. I am using code that ran on 1.1.6  
but as  
soon as I moved to 2.0.2 I get this error. Have you found a solution?

haarts wrote:

> render “user\_mailer/signup”  
> That did not work. Neither did;  
> Harm
> 
> >

–  
View this message in context:  
[http://www.nabble.com/Actionmailer-and-mailer\_name-tp15357010p15402871.html](http://www.nabble.com/Actionmailer-and-mailer_name-tp15357010p15402871.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [February 11, 2008, 9:22am UTC](https://www.ruby-forum.com/t/actionmailer-and-mailer-name/128540/3 "2008-02-11T09:22:50Z")

</div>

I did, well sort of. I my case it did have to do with Globalize. I  
think it is because Globalize is not Rails 2.0 compatible(yet). I had  
to comment out the inclusion of the action\_mailer require in the  
init.rb of the plugin. After that it at least worked. Sorry I can not  
be of more help.

With kind regards,  
Harm

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [February 11, 2008, 3:03pm UTC](https://www.ruby-forum.com/t/actionmailer-and-mailer-name/128540/4 "2008-02-11T15:03:13Z")

</div>

Thanks! Yes, it turns out in my case that this was due to some old  
localization code (code that was required to use the old salted password  
generator).

This old code overrides the render\_message method of ActionMailer, but  
does  
so in a way that is incompatible with 2.0.2. I haven’t spent the time  
to  
fix it yet, but when I do I will post the fix here.

haarts wrote:

> > > or;  
> > > –  
> > > View this message in  
> > > context:[http://www.nabble.com/Actionmailer-and-mailer\_name-tp15357010p1540287](http://www.nabble.com/Actionmailer-and-mailer_name-tp15357010p1540287)…  
> > > Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).

–  
View this message in context:  
[http://www.nabble.com/Actionmailer-and-mailer\_name-tp15357010p15412035.html](http://www.nabble.com/Actionmailer-and-mailer_name-tp15357010p15412035.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).
