123456789_123456789_123456789_123456789_123456789_

Class: Mail::Message

Instance Method Summary

Instance Method Details

#bcc_addresses

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/addresses.rb', line 21

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

#cc_addresses

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/addresses.rb', line 17

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

#from_address

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/addresses.rb', line 5

def from_address
  header[:from]&.address_list&.addresses&.first
end

#recipients

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/recipients.rb', line 5

def recipients
  Array(to) + Array(cc) + Array(bcc) + Array(header[:x_original_to]).map(&:to_s)
end

#recipients_addresses

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/addresses.rb', line 9

def recipients_addresses
  to_addresses + cc_addresses + bcc_addresses + x_original_to_addresses
end

#to_addresses

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/addresses.rb', line 13

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

#x_original_to_addresses

[ GitHub ]

  
# File 'actionmailbox/lib/action_mailbox/mail_ext/addresses.rb', line 25

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