Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Email Service via /api/send #41

Closed
1 task done
nelsonic opened this issue Mar 27, 2020 · 3 comments
Closed
1 task done

Integrate Email Service via /api/send #41

nelsonic opened this issue Mar 27, 2020 · 3 comments
Assignees
Labels
awaiting-review An issue or pull request that needs to be reviewed enhancement New feature or enhancement of existing functionality T1h Time Estimate 1 Hour

Comments

@nelsonic
Copy link
Member

nelsonic commented Mar 27, 2020

We have finished building the separate email service #39 https://github.com/dwyl/email
Now we need to use that service to send welcome emails when people authenticate.

In the context of our diagram, we are performing Step 3:
dwyl-app-services-diagram

@nelsonic nelsonic added the enhancement New feature or enhancement of existing functionality label Mar 27, 2020
@nelsonic nelsonic self-assigned this Mar 27, 2020
@nelsonic nelsonic added the T1h Time Estimate 1 Hour label Mar 27, 2020
@nelsonic
Copy link
Member Author

Annoying error when attempting to use a JWT in Authorization header:

  1) test AuthMvp.Email send/1 an email (AuthMvp.EmailTest)
     test/auth_mvp/email_test.exs:5
     ** (ArgumentError) argument error
     code: res = AuthMvp.Email.send(params)
     stacktrace:
       :erlang.iolist_to_binary([Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJKb2tlbiIsImVtYWlsIjoic3VjY2Vzc0BzaW11bGF0b3IuYW1hem9uc2VzLmNvbSIsImV4cCI6MTYxNjg2MDcyOSwiaWF0IjoxNTg1MzIzNzI5LCJpc3MiOiJKb2tlbiIsImp0aSI6IjJvMDM3MjJhYjA0bmg4bGppazAwMDBmMSIsIm5hbWUiOiJTdXBlciBTdWNjZXNzZnVsIiwibmJmIjoxNTg1MzIzNzI5LCJ0ZW1wbGF0ZSI6IndlbGNvbWUifQ.iVjxMsyCTmaem_N4TH3YiXOasTPIGTHR0XOpnlEK2qc", "Content-Type": "application/json"])
       (hackney 1.15.2) /Users/n/code/auth-mvp/deps/hackney/src/hackney_request.erl:348: :hackney_request.handle_body/4
       (hackney 1.15.2) /Users/n/code/auth-mvp/deps/hackney/src/hackney_request.erl:83: :hackney_request.perform/2
       (hackney 1.15.2) /Users/n/code/auth-mvp/deps/hackney/src/hackney.erl:376: :hackney.send_request/2
       (httpoison 1.6.2) lib/httpoison/base.ex:796: HTTPoison.Base.request/6
       (auth_mvp 0.1.0) lib/auth_mvp/email.ex:14: AuthMvp.Email.send/1
       test/auth_mvp/email_test.exs:12: (test)

nelsonic added a commit to dwyl/auth-mvp that referenced this issue Mar 27, 2020
nelsonic added a commit to dwyl/auth-mvp that referenced this issue Mar 27, 2020
@nelsonic nelsonic mentioned this issue Mar 27, 2020
1 task
@nelsonic
Copy link
Member Author

Figured out the hackney error. It was because of an incorrect ordering of parameters.
The correct code is:
https://github.com/dwyl/auth-mvp/blob/556f1b186c5399a42004ff047e4f5a8de08ee069/lib/auth_mvp/email.ex#L31

PR dwyl/auth-mvp#17 created. ✅

@nelsonic nelsonic added the awaiting-review An issue or pull request that needs to be reviewed label Mar 27, 2020
@nelsonic nelsonic assigned SimonLab and unassigned nelsonic Mar 27, 2020
nelsonic added a commit that referenced this issue Apr 15, 2020
nelsonic added a commit that referenced this issue Apr 15, 2020
@nelsonic
Copy link
Member Author

Included in #43 💌 ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed enhancement New feature or enhancement of existing functionality T1h Time Estimate 1 Hour
Projects
None yet
Development

No branches or pull requests

2 participants