Reading e-mail bodies

18 views
Skip to first unread message

Jeffrey Taylor

unread,
Jul 29, 2016, 10:13:08 PM7/29/16
to Google API Client for Ruby
I must be missing something.  I appended the code below to the sample quickstart code.  It shows the correct number of messages, but both raw and payload return nil.

TIA,
  Jeffrey

label_ids = 'UNREAD'
result = service.list_user_messages(user_id, label_ids: 'UNREAD';
puts "#{result.messages.size} messages."
puts result.messages[0].class
puts "Messages:"
result.messages.each {|msg| puts msg.raw.inspect }

Jeffrey Taylor

unread,
Jul 29, 2016, 11:10:07 PM7/29/16
to Google API Client for Ruby
Figured it out.  Have to call get_user_message with each id.
Reply all
Reply to author
Forward
0 new messages