Setting "From" in Mailer model


#1

At the moment mail sent from my app comes from “mailer” when received by
gmail. Is it possible (i.e. some particular format) to make this more
meaningful?

What I have at the moment one of my typical mailer methods:

def updated
recipients users.collect(&:email).join(’,’)
from “removed_email_address@domain.invalid”
subject some_subject
body
end


#2

Whoops, by meaningful I mean, appearing in my inbox as coming from
MyDomain.com Mailer” instead of just “mailer”

Luke G. wrote:

At the moment mail sent from my app comes from “mailer” when received by
gmail. Is it possible (i.e. some particular format) to make this more
meaningful?

What I have at the moment one of my typical mailer methods:

def updated
recipients users.collect(&:email).join(’,’)
from “removed_email_address@domain.invalid”
subject some_subject
body
end


#3

Luke G. wrote:

Whoops, by meaningful I mean, appearing in my inbox as coming from
MyDomain.com Mailer” instead of just “mailer”

Luke G. wrote:

At the moment mail sent from my app comes from “mailer” when received by
gmail. Is it possible (i.e. some particular format) to make this more
meaningful?

What I have at the moment one of my typical mailer methods:

def updated
recipients users.collect(&:email).join(’,’)
from “removed_email_address@domain.invalid”
subject some_subject
body
end

I use the format

from “Some P. removed_email_address@domain.invalid

Peace.


#4

Luke G. wrote:

def updated
recipients users.collect(&:email).join(’,’)
from “removed_email_address@domain.invalid”
subject some_subject
body
end

You’d write:

from ‘MyDomain.com Mailer removed_email_address@domain.invalid

If the email sender is common to all mailer methods
you can move this “from” call to the initialize method,
so it only has to appear once.


Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com


#5

Excellent! Just what I was looking for! :smiley: