Skip to content

nisanthchunduru/gmail-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gmail

Ruby gem for Gmail's API

Installation

Add the gem to your Rails app's Gemfile

gem "gmail", git: "https://github.com/nisanthchunduru/gmail-ruby", branch: "main"

and bundle install

bundle install

Usage

gmail = Gmail.new(google_oauth_access_token)

# Fetch the 100 most recent messages and print a snippet of the each message
messages = gmail.messages
messages.each { |message| puts message.snippet }

# Fetch the next 100 most recent messages and print a snippet of each message
messages = messages.next_page
messages.each { |message| puts message.snippet }

# Find a message by its RFC 2822 Message-ID
message_id = "[email protected]"
message = gmail.find_message_by_message_id(message_id)

# Fetch a message's raw and print it
puts message.retrieve("format" => "raw").raw

Todos

  • Port tests from the app
  • Modify the Gmail::Message.raw method to fetch the message in the raw format so gem users don't have to do it themselves
  • Add a license
  • Publish to rubygems.org

About

Ruby gem for Gmail API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages