elixir-gmail icon indicating copy to clipboard operation
elixir-gmail copied to clipboard

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

Open silvagustin opened this issue 5 years ago • 1 comments

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.

silvagustin avatar Nov 11 '20 21:11 silvagustin

I had this same issue, and I realized it was because I had not added the client id and client secret to my config file. Look at the dev.exs.sample config file in the repo for an example of what it should look like. That solved it for me!

emilykay2 avatar Oct 08 '21 15:10 emilykay2