# Action Mailer Problem, please help

**URL:** <https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504>\
**Category:** Rails\
**Created:** [November 7, 2007, 3:21pm UTC](https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504 "2007-11-07T15:21:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![myowntribe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@myowntribe](https://www.ruby-forum.com/u/myowntribe)\
**Post date:** [November 7, 2007, 3:21pm UTC](https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504/1 "2007-11-07T15:21:46Z")

</div>

Hi I should be missing something really basic to not get this right…

1. I need to get the name of the user and some custom text in the  
subject field in the mailer
2. I need to get the name of the website instead of the full email  
address in the from field.

Here is my method in the invitation\_mailer.rb:

def invitation(email, invitation, sent\_at = Time.now)  
@subject = invitation.user.name  
@body[:invitation] = invitation.title, invitation.comments  
@body[:user] = invitation.user.name  
@recipients = email  
@from = ‘removed\_email\_address@domain.invalid’  
@sent\_on = sent\_at  
end

This method just gives the sender’s name in the subject field, now I  
need the subject field to be like this:

“Linda invites you to join her on MYOWNTRIBE”

and the From filed to be like this: “MYOWNTRIBE”

Could anyone please guide me…

Cheers

Cass

---

<div class="post-metadata">

**Author:** ![myowntribe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@myowntribe](https://www.ruby-forum.com/u/myowntribe)\
**Post date:** [November 7, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504/2 "2007-11-07T16:44:55Z")

</div>

On 7 Nov 2007, at 14:21, Cass A. wrote:

> Could anyone please guide me…  
> This is really basic ruby - you’ll run into trouble if you don’t know  
> stuff like this  
> The #{} construct allows this sort of stuff, ie

message = ‘Hello’  
puts “The message is #{message}”  
will print The message is Hello

Fred

---

<div class="post-metadata">

**Author:** ![myowntribe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@myowntribe](https://www.ruby-forum.com/u/myowntribe)\
**Post date:** [November 7, 2007, 5:00pm UTC](https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504/3 "2007-11-07T17:00:29Z")

</div>

Hmm… thanks Fred, I knew I was missing something very basic…

Cheers

Cass

Frederick C. wrote:

> On 7 Nov 2007, at 14:21, Cass A. wrote:
> 
> > Could anyone please guide me…  
> > This is really basic ruby - you’ll run into trouble if you don’t know  
> > stuff like this  
> > The #{} construct allows this sort of stuff, ie
> 
> message = ‘Hello’  
> puts “The message is #{message}”  
> will print The message is Hello
> 
> Fred

---

<div class="post-metadata">

**Author:** ![myowntribe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@myowntribe](https://www.ruby-forum.com/u/myowntribe)\
**Post date:** [November 7, 2007, 5:07pm UTC](https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504/4 "2007-11-07T17:07:27Z")

</div>

Hi Fred, I got it working now 🙂 Thanks

Cass

---

<div class="post-metadata">

**Author:** ![myowntribe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@myowntribe](https://www.ruby-forum.com/u/myowntribe)\
**Post date:** [November 7, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/action-mailer-problem-please-help/119504/5 "2007-11-07T17:11:18Z")

</div>

Watch the Railscast for sending email =\> [www.railscasts.com](http://www.railscasts.com)

On Nov 7, 11:00 am, Cass A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
