stumash / CoursePlanner

http://conucourseplanner.online
MIT License
5 stars 3 forks source link

added feedback emailer servlet #134

Closed Davidster closed 6 years ago

Davidster commented 6 years ago

related to issue #133

Summary

Added a new servlet POST at /api/feedback. Basically you send it a message prop in the request:

{"message" : "your website sucks."}

and it responds with whether the email was sent succesfully:

{"success" : "true"}

It uses the Apache commons email Java library to send the email. Just like the webscraping storers, it uses our gmail account concordiacourseplanner@gmail.com to authenticate with the gmail smtp server but it sends the email only to itself, not to all our personal gmails. So basically all the feedback we get will be listed as received emails if you log into that account on gmail.com.

Test

Try sending the request on courseplannerd:

curl -H "Content-Type: application/json" -X POST -d '{"message": "your website sucks."}' http://conucourseplanner.online/courseplannerd/api/feedback

Then log in and make the sure the email was received.

Hint: see diffs for gmail password 😉