Coder Social home page Coder Social logo

elixir-gmail's People

Contributors

craigp avatar johansja avatar killtheliterate avatar msch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

elixir-gmail's Issues

Can't make Gmail.User.start_mail() work

Hi! I'm trying to use this dependency and after setting everything up and running:
{:ok, pid} = Gmail.User.start_mail(user_email, user_refresh_token)

I got the following error:
** (MatchError) no match of right hand side value: {:error, {:function_clause, [{Gmail.OAuth2, :do_refresh_access_token, [%{}, "1//04ml-27by0C3PCgYIARAAGAQSNwF-L9Irco4pMbDE1fJWAG38b-LpVPd-sfm9V9Fr6-3Xk-0Ecp883KXO40eANwViDYqCW3klUWU"], [file: 'lib/gmail/oauth2.ex', line: 53]}, {Gmail.OAuth2, :refresh_access_token, 1, [file: 'lib/gmail/oauth2.ex', line: 34]}, {Gmail.User, :init, 1, [file: 'lib/gmail/user.ex', line: 20]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 417]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 385]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}}

Is this still working?

Cheers.

Gmail User Watch

So I've gone through the docs and I can't seem to find a way to watch for new messages as specified by this:

POST "https://www.googleapis.com/gmail/v1/users/me/watch"
Content-type: application/json

{
  topicName: "projects/myproject/topics/mytopic",
  labelIds: ["INBOX"],
}

https://developers.google.com/gmail/api/guides/push

wrong spec for `Gmail.User.attachment/3`?

Dialyzer gives me an error for this code:

{:ok, attachment} = Gmail.User.attachment("foo@bar", mail.id, attachment_part.body.attachment_id)

The message is:

The pattern can never match the type.

Pattern:
{:ok, _attachment}

Type:
atom()

combo with ueberauth

Hi Craig,

I'm trying to use your library to read from an inbox, I'm doing the initial auth with Ueberauth successfully,
but when i try and start a gmail process i get an error

{:ok, pid} = Gmail.User.start_mail(conn.assigns.user.email, "user-refresh-token")

this is the code, the assigns.users struct comes from ueberauth

and the error is:

  • (MatchError) no match of right hand side value: {:error, {{:badmatch, {:error, {:ok, %{"error" => "invalid_grant"}}}}, [{Gmail.OAuth2, :refresh_access_token, 1, [file: 'lib/gmail/oauth2.ex', line: 35]}, {Gmail.User, :init, 1, [file: 'lib/gmail/user.ex', line: 20]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 328]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}

any suggestions what im doing wrong?

thanks!

dan

Could not start application gmail

I'm getting this after adding gmail to my mix.exs in a phoenix app

** (Mix) Could not start application gmail: Gmail.start(:normal, []) returned an error: shutdown: failed to start child: Gmail.Thread.Pool
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in Keyword.get/3
            (elixir) lib/keyword.ex:150: Keyword.get(nil, :pool, nil)
            (gmail) lib/gmail/thread/pool.ex:48: Gmail.Thread.Pool.pool_size/0
            (gmail) lib/gmail/thread/pool.ex:18: Gmail.Thread.Pool.start_link/0
            (stdlib) supervisor.erl:365: :supervisor.do_start_child/2
            (stdlib) supervisor.erl:348: :supervisor.start_children/3
            (stdlib) supervisor.erl:314: :supervisor.init_children/2
            (stdlib) gen_server.erl:328: :gen_server.init_it/6
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Add ability to fetch message attachments

#4 has a WIP pull request. Caveat: I'm learning elixir, this is pretty much the first thing I've written. Being able to cut/paste code from elsewhere in the project is pretty illuminating.

How to get the current refresh token for a user

When restarting the current refresh token for a user gets lost and I am no longer able to authorize access for this user. To avoid that I create a new refresh token in a teardown function and save that; but is there a better way? Maybe a notification every time a new refresh token gets created so I can save it somewhere?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.