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

Send email endpoint #37

Merged
merged 5 commits into from
Jul 1, 2021
Merged

Conversation

andreformento
Copy link
Collaborator

@andreformento andreformento commented Jun 5, 2021

closes #23

@jvanz @giuliocc

Changes

  • create a new endpoint for suggestions POST /suggestions
  • now application need to have another environment variable, like you can see on config/sample.env file
  • you need to create a token at Mailjet to run application and send email (put on config/current.env)

Test

  • Make a POST request
curl -X POST -vv "http://localhost:8080/suggestions" -H  "accept: application/json" -H  "Content-Type: application/json" -d '{
    "email_address": "[email protected]",
    "name": "My Name",
    "content": "Suggestion content"
}'
  • status code response need to be 200 OK
  • body response need to be
{ "status": "sent" }

@andreformento andreformento force-pushed the send-email-endpoint branch from 01c6972 to a5ffc55 Compare June 5, 2021 23:25
@ogecece
Copy link
Member

ogecece commented Jun 9, 2021

I'm setting up the environment to take a look at this

@ogecece
Copy link
Member

ogecece commented Jun 10, 2021

As we discussed, we found it better to maintain #33 open and remove the remote elasticsearch features from this PR.

suggestions/service.py Outdated Show resolved Hide resolved
Copy link
Member

@ogecece ogecece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the modifications! Now I could focus on some aspects that I couldn't before, I think these should be my final requests :)

config/sample.env Outdated Show resolved Hide resolved
suggestions/service.py Outdated Show resolved Hide resolved
suggestions/service.py Outdated Show resolved Hide resolved
config/sample.env Outdated Show resolved Hide resolved
suggestions/service.py Outdated Show resolved Hide resolved
tests/test_suggestion_service.py Show resolved Hide resolved
tests/test_api.py Show resolved Hide resolved
api/api.py Outdated Show resolved Hide resolved
suggestions/service.py Outdated Show resolved Hide resolved
tests/test_suggestion_service.py Show resolved Hide resolved
@jvanz jvanz added the enhancement New feature or request label Jun 18, 2021
@jvanz jvanz requested review from ogecece and jvanz June 24, 2021 19:55
README.md Show resolved Hide resolved
config/config.py Outdated Show resolved Hide resolved
suggestions/service.py Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@andreformento andreformento force-pushed the send-email-endpoint branch 3 times, most recently from 1c1cdcc to 2c396d4 Compare June 26, 2021 12:41
reset some files

fix api

fixes

set required fields

fix prefix properties name

rename

change subject and title

fix test

fix test

rename from SuggestionService to SuggestionServiceInterface

test create_suggestion_service

implements api tests
@andreformento andreformento requested a review from jvanz June 27, 2021 16:55
api/api.py Outdated Show resolved Hide resolved
@jvanz
Copy link
Collaborator

jvanz commented Jun 28, 2021

Have you test this PR with actual Mailjet credentials?

@andreformento
Copy link
Collaborator Author

Have you test this PR with actual Mailjet credentials?

Yes, I created a new account (personal) and tested. Do you want some help to do that?

@andreformento andreformento requested a review from jvanz June 29, 2021 23:44
Copy link
Member

@ogecece ogecece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it. Everything is working fine! LGTM

image

@jvanz do you have anything to add?

@jvanz jvanz merged commit 00782d9 into okfn-brasil:main Jul 1, 2021
@andreformento andreformento deleted the send-email-endpoint branch July 2, 2021 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send e-mail endpoint
3 participants