instance method destinations

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

destinations( default = nil )

Returns an array of each destination in the email message including to: cc: or bcc:

Example:

mail.to = "Mikel <mikel@lindsaar.net>"
mail.cc = "Trans <t@t.com>"
mail.bcc = "bob <bob@me.com>"
mail.destinations #=> ["mikel@lindsaar.net", "t@t.com", "bob@me.com"]

Parameters

default opt = nil
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb, line 1010
    def destinations( default = nil )
      ret = []
      %w( to cc bcc ).each do |nm|
        if h = @header[nm]
          h.addrs.each {|i| ret.push i.address }
        end
      end
      ret.empty? ? default : ret
    end

Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb line 1010 · View on GitHub · Improve this page · Find usages on GitHub

Defined in TMail::Mail

Type at least 2 characters to search.

↑↓ navigate · open · esc close