def extract_to(rails_message, format: :full)
      to = complex_extract(rails_message.to.first)
      return to[:value] if to[:decoded]

      case format
      when :full
        rails_message[:to].formatted.first
      when :name
        rails_message[:to].address_list.addresses.first.name
      when :address
        rails_message[:to].address_list.addresses.first.address
      end
    end
def extract_to(rails_message, format: :full)
      to = complex_extract(rails_message.to.first)
      return to[:value] if to[:decoded]

      case format
      when :full
        rails_message[:to].formatted.first
      when :name
        rails_message[:to].address_list.addresses.first.name
      when :address
        rails_message[:to].address_list.addresses.first.address
      end
    end
format can be full|name|address