Skip to content

smithbn/gmailr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmailr

Build Status Coverage Status

Easily exposing the Gmail API from R.

Features

  • retrieve data from your email
    • drafts: my_drafts = drafts()
    • history: my_history = history(start_num)
    • labels: my_labels = labels()
    • messages: my_messages = messages("search query")
    • threads: my_threads = threads("search query")
  • Create and send emails and drafts: see sending_messages vignette
  • manage email labels programmatically: modify_thread(thread_id, add_labels=c("label_1"), remove_labels=c("label_2"))
  • put things in the gmail trash
    • messages: trash_message(message_id)
    • threads: trash_thread(thread_id)
  • take things out of the gmail trash
    • messages: untrash_message(message_id)
    • threads: untrash_thread(thread_id)
  • delete directly without using the trash
    • messages: delete_message(message_id)
    • threads: delete_thread(thread_id)

Setup

  • Register a new project at https://cloud.google.com/console#/project

  • Navigate to APIs

    • Switch the Gmail API status to On, and other API status to Off
  • Navigate to APIs & auth->Consent screen

    • Name your application
    • Select an email address for the application
    • Other fields can be left blank
  • Navigate to APIs & auth->Credentials

    • Create a new client ID
      • Application Type: Installed Application
      • Installed Application Type: Other
    • Download the Client ID JSON - can be renamed!
  • Use the downloaded JSON file as input to gmail_auth()

    ```R
    gmail_auth('file.json')
    ```
    

Examples

About

Access the Gmail RESTful API from R.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 98.3%
  • Makefile 1.7%