Sha256: 66a3b175b2697c4c3ebf3e5563b41c50db96850bf26d102680f7169ef663bc37

Contents?: true

Size: 634 Bytes

Versions: 98

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

module Mail
  class Message
    def from_address
      header[:from]&.address_list&.addresses&.first
    end

    def recipients_addresses
      to_addresses + cc_addresses + bcc_addresses + x_original_to_addresses
    end

    def to_addresses
      Array(header[:to]&.address_list&.addresses)
    end

    def cc_addresses
      Array(header[:cc]&.address_list&.addresses)
    end

    def bcc_addresses
      Array(header[:bcc]&.address_list&.addresses)
    end

    def x_original_to_addresses
      Array(header[:x_original_to]).collect { |header| Mail::Address.new header.to_s }
    end
  end
end

Version data entries

98 entries across 94 versions & 7 rubygems

Version Path
actionmailbox-6.1.7.10 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.9 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.8 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.7 lib/action_mailbox/mail_ext/addresses.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionmailbox-7.0.3.1/lib/action_mailbox/mail_ext/addresses.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionmailbox-6.1.6.1/lib/action_mailbox/mail_ext/addresses.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actionmailbox-7.0.2.3/lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.6 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.5 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.4 lib/action_mailbox/mail_ext/addresses.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionmailbox-7.0.3.1/lib/action_mailbox/mail_ext/addresses.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionmailbox-6.1.6.1/lib/action_mailbox/mail_ext/addresses.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actionmailbox-7.0.2.3/lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.4.3 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.3 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.2 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.4.2 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.4.1 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7.1 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.6.1 lib/action_mailbox/mail_ext/addresses.rb