All Projects → craigp → elixir-gmail

craigp / elixir-gmail

Licence: MIT License
A Gmail API client for Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to elixir-gmail

gmail-gitlab-filtering
Google Apps Script for Gmail to filter and sort email from GitLab
Stars: ✭ 84 (+82.61%)
Mutual labels:  gmail, gmail-api
CubeMail
CubeMail is a webmail client built using React and Chakra UI, It runs in the browser and uses the Gmail's public Javascript API.
Stars: ✭ 25 (-45.65%)
Mutual labels:  gmail, gmail-api
google-workspace
A unofficial high level Python API wrapper for some of the productivity based Google APIs, that is focused on simplicity.
Stars: ✭ 74 (+60.87%)
Mutual labels:  gmail, gmail-api
polybar-gmail
A Polybar module to show unread messages from Gmail
Stars: ✭ 76 (+65.22%)
Mutual labels:  gmail
qgmail
Access the power of Gmail API through your terminal.
Stars: ✭ 21 (-54.35%)
Mutual labels:  gmail-api
Gmail-Clone
A Gmail Clone which built with ReactJS and Redux. You can sign in with your Google Account, compose a new e-mail and send realtime emails to the project.
Stars: ✭ 48 (+4.35%)
Mutual labels:  gmail
maildir2gmail
Maildir 2 Gmail
Stars: ✭ 14 (-69.57%)
Mutual labels:  gmail
KP.GmailClient
A Gmail client for C#
Stars: ✭ 17 (-63.04%)
Mutual labels:  gmail
sharon
A lightweight and modular social sharing library
Stars: ✭ 16 (-65.22%)
Mutual labels:  gmail
emailpyspam
A python 3+ program to spam emails to a list of users repetitively
Stars: ✭ 63 (+36.96%)
Mutual labels:  gmail
Events-based-organizational-website
The official codebase for college-based (event managing) organizations. FOUR-LEVEL Authorization system and scalable.
Stars: ✭ 14 (-69.57%)
Mutual labels:  gmail-api
argus
Argus Advanced Remote & Local Keylogger For macOS and Windows
Stars: ✭ 87 (+89.13%)
Mutual labels:  gmail
mailto
💌 ⚡️ The mailto encoder
Stars: ✭ 157 (+241.3%)
Mutual labels:  gmail
smtplib-bruteforce
bruteforcing gmail (TLS/SSL)
Stars: ✭ 26 (-43.48%)
Mutual labels:  gmail
briskine
Write faster with templates and keyboard shortcuts.
Stars: ✭ 88 (+91.3%)
Mutual labels:  gmail
enmasse
📫 enmasse – Templated emails for GMail.
Stars: ✭ 23 (-50%)
Mutual labels:  gmail
Google-Clone
A Google Clone which built with ReactJS. When you click Gmail button, you will be directed to my other project, Gmail Clone. You can search whatever you want and send realtime emails by clicking Gmail button!
Stars: ✭ 37 (-19.57%)
Mutual labels:  gmail
unattach
Unattach allows you to free your Google storage by easily downloading and/or removing Gmail attachments from many emails at once.
Stars: ✭ 110 (+139.13%)
Mutual labels:  gmail
modmail
Extremely Moddable Gmail
Stars: ✭ 12 (-73.91%)
Mutual labels:  gmail
gmail-clj
A Clojure library that abstracts the GMail API (not the IMAP) interface.
Stars: ✭ 33 (-28.26%)
Mutual labels:  gmail

elixir-gmail

Build Status Coverage Status hex.pm version hex.pm downloads Inline docs

A simple Gmail REST API client for Elixir.

You can find the hex package here, and the docs here.

You can find documentation for Gmail's API at https://developers.google.com/gmail/api/

Usage

First, add the client to your mix.exs dependencies:

def deps do
  [{:gmail, "~> 0.1"}]
end

Then run $ mix do deps.get, compile to download and compile your dependencies.

Finally, add the :gmail application as your list of applications in mix.exs:

def application do
  [applications: [:logger, :gmail]]
end

Before you can work with mail for a user you'll need to start a process for them.

{:ok, pid} = Gmail.User.start_mail("[email protected]", "user-refresh-token")

When a user process starts it will automatically fetch a new access token for that user. Then you can start playing with mail:

# fetch a list of threads
{:ok, threads, next_page_token} = Gmail.User.threads("[email protected]")

# fetch the next page of threads using a page token
{:ok, _, _} = Gmail.User.threads("[email protected]", %{page_token: next_page_token})

# fetch a thread by ID
{:ok, thread} = Gmail.User.thread("[email protected]", "1233454566")

# fetch a list of labels
{:ok, labels} = Gmail.User.labels("[email protected]")

Check the docs for a more complete list of functionality.

API Support

  • Threads
    • get
    • list
    • modify
    • delete
    • trash
    • untrash
  • Messages
    • delete
    • get
    • insert
    • list
    • modify
    • send
    • trash
    • untrash
    • import
    • batchDelete
  • Labels
    • create
    • delete
    • list
    • update
    • get
    • update
    • patch
  • Drafts
    • list
    • get
    • delete
    • update
    • create
    • send
    • send (with upload)
  • History
    • list
  • Attachments
    • get (thanks to @killtheliterate)

Auth

As of now the library doesn't do the initial auth generation for you; you'll need to create an app on the Google Developer Console to get a client ID and secret and authorize a user to get an authorization code, which you can trade for an access token.

The library will however, when you supply a refresh token, use that to refresh an expired access token for you. Take a look in the dev.exs.sample config file to see what your config should look like.

TODO

  • Stop mocking HTTP requests and use Bypass instead
  • Add format option when fetching threads
  • .. and messages
  • .. and drafts
  • Batched requests
  • Document the config (specifically pool size)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].