# ActionMailer

**URL:** <https://www.ruby-forum.com/t/actionmailer/81276>\
**Category:** Rails\
**Created:** [January 6, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/actionmailer/81276 "2007-01-06T19:30:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 6, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/actionmailer/81276/1 "2007-01-06T19:30:57Z")

</div>

I would like to do something like this

class MailHandler \< ActionMailer  
def one  
end

def two  
end  
end

class InfoHandler \< MailHandler  
def three  
end  
end

class NewHandler \< MailHandler  
def three  
end  
end

The problem is that with the single inheritance I can not access the  
ActionMailer methods. Any one have any idea how I can do this.

Thanks,  
Amos

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 19, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/actionmailer/81276/2 "2007-01-19T16:29:23Z")

</div>

removed\_email\_address@domain.invalid wrote:

> class InfoHandler \< MailHandler  
> def three  
> end  
> end
> 
> class NewHandler \< MailHandler  
> def three  
> end  
> end

module SnazzyMixin  
def one  
end

def two  
end  
end

class InfoHandler \< AM  
include SnazzyMixin

def three  
end  
end

class NewHandler \< AM  
include SnazzyMixin

def three  
end  
end

perhaps?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 25, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/actionmailer/81276/3 "2007-09-25T22:30:16Z")

</div>

Does this allow the SnazzyMixin to have access to ActionMailer?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 25, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/actionmailer/81276/4 "2007-09-25T22:42:30Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Does this allow the SnazzyMixin to have access to ActionMailer?

I guess I am a bit confused. If you have the following:

class A  
def foo  
“foo”  
end  
def snap  
“snap”  
end  
end

class B \< A  
def bar  
“bar”  
end  
def snap  
“crackle”  
end  
end

a = A.new  
b = B.new

a.foo # =\> “foo”  
b.foo # =\> “foo”  
b.bar # =\> “bar”  
a.snap # =\> “snap”  
b.snap # =\> “crackle”
