instance method
friendly_from
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
friendly_from( default = nil )
Returns the “friendly” human readable part of the address
Example:
mail = TMail::Mail.new mail.from = "Mikel Lindsaar <mikel@abc.com>" mail.friendly_from #=> "Mikel Lindsaar"
Parameters
-
defaultopt = nil
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb, line 403
def friendly_from( default = nil )
h = @header['from']
a, = h.addrs
return default unless a
return a.phrase if a.phrase
return h.comments.join(' ') unless h.comments.empty?
a.spec
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb line 403
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in TMail::Mail