CougarCS / CougarCS-Backend

An Express API to service the CougarCS website.
5 stars 27 forks source link

Create an endpoint for newsletter subscriptions #212

Open shubhsheth opened 2 years ago

shubhsheth commented 2 years ago

Add an endpoint in the API that take in a POST request with following fields:

Validate this input using express-validator

Send this information to sendgrid mailing list using Sendgrid API, link to sendgrid documentation (https://docs.sendgrid.com/api-reference/contacts-api-lists/add-a-single-recipient-to-a-list)

Notes:

mayankdp commented 2 years ago

I have created a backend for this newsletter similar to email.js. I am pushing my codes to the newsletterendpoint branch. Please check it and let me know. I want to create a pull request for approval so that I can submit the summary of this issue to my professor by the end of the work.

shubhsheth commented 2 years ago

@mayankdp The newsletter follows the same format as email endpoint but instead of sending email it stores the email in the mailing list. (https://docs.sendgrid.com/api-reference/contacts/add-or-update-a-contact)

I looked at your code, I think it's not ready to merge into master branch for the above reasons. You can create a pull request to merge it in a feature branch 'feature/newsletter' and then continue working on it after submitting the summary.