craigp / elixir-gmail Goto Github PK
View Code? Open in Web Editor NEWA Gmail API client for Elixir
License: MIT License
A Gmail API client for Elixir
License: MIT License
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.
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"],
}
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()
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:
any suggestions what im doing wrong?
thanks!
dan
Lets say you're trying to get messages that match a q
param. If there are known, an exception is thrown.
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
#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.
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?
When getting a message, attachmentID is missing in payload.body.
https://developers.google.com/gmail/api/v1/reference/users/messages/get
https://developers.google.com/gmail/api/v1/reference/users/messages/attachments#resource
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.