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-7.0.4 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.7 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.6 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.3.1 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.6.1 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.5.1 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.5 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.6 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.3 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.2.4 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.5.1 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.4.8 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.5 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.2.3 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.4.7 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.4.7 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-7.0.2.2 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.1.4.6 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.4.6 lib/action_mailbox/mail_ext/addresses.rb
actionmailbox-6.0.4.5 lib/action_mailbox/mail_ext/addresses.rb