# How to access application\_helper methods in mailer templates

**URL:** <https://www.ruby-forum.com/t/how-to-access-application-helper-methods-in-mailer-templates/126073>\
**Category:** Rails\
**Created:** [January 15, 2008, 7:30am UTC](https://www.ruby-forum.com/t/how-to-access-application-helper-methods-in-mailer-templates/126073 "2008-01-15T07:30:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [January 15, 2008, 7:30am UTC](https://www.ruby-forum.com/t/how-to-access-application-helper-methods-in-mailer-templates/126073/1 "2008-01-15T07:30:51Z")

</div>

Hi,

I am not able to access application\_helper methods in my mailer  
templates.  
It throws out error saying method not defined. I was assuming all  
templates  
under views should have access to application helper methods, but it is  
not  
the case. Any solution?

–  
Anil

> **[Anil Wadghule](https://anilwadghule.com)**
>
> Anil Wadghule - Elixir, Phoenix Software Developer

---

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [January 15, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/how-to-access-application-helper-methods-in-mailer-templates/126073/2 "2008-01-15T17:54:03Z")

</div>

On 1/15/08, Anil W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I am not able to access application\_helper methods in my mailer templates.  
> It throws out error saying method not defined. I was assuming all templates  
> under views should have access to application helper methods, but it is not  
> the case. Any solution?

You can always put the methods in config/environment.rb.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![anildigital](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anildigital](https://www.ruby-forum.com/u/anildigital)\
**Post date:** [January 15, 2008, 5:57pm UTC](https://www.ruby-forum.com/t/how-to-access-application-helper-methods-in-mailer-templates/126073/3 "2008-01-15T17:57:39Z")

</div>

Add helper:application to the top of your Mailer class

for example:

class MessagingNotifier \< ActionMailer::Base  
helper :application

…  
end
