Added Email functionality to Contact Us Page #119
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved Issue #117
Added Email Functionality to ContactUs Page
Key Changes:
Created a new API endpoint
/api/sendEmail
to handle form submissions and send emails.Integrated Nodemailer to send emails to codingclub@iiitvadodara.ac.in.
Added environment variables for email credentials:
EMAIL_USER=
(for the sender email)EMAIL_PASSWORD=
(for the sender email password)All form fields (Name, Email, Contact No., Organisation, Message/Bug) are included in the email body.
![Screenshot 2024-10-22 025748](https://private-user-images.githubusercontent.com/146441689/378607066-4f99c342-4f5d-485b-a239-f0e20951ce26.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzUyODI5MzAsIm5iZiI6MTczNTI4MjYzMCwicGF0aCI6Ii8xNDY0NDE2ODkvMzc4NjA3MDY2LTRmOTljMzQyLTRmNWQtNDg1Yi1hMjM5LWYwZTIwOTUxY2UyNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMjI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTIyN1QwNjU3MTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMzk3M2Y3Y2UwMTQxMzA2NmE4ZWIxNmYwNjgxN2FjMjJiOGUyYWQ2YWM1NDE1YWMyZmU4MTk3OWY2Mzk1ODU2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.C3qbj7aLOwocTJC1SpTBpJuc8N-jpq1selCn5SZLCeY)
Error handling for cases like email sending failure, with user feedback provided on form submission.
![Screenshot 2024-10-22 025839](https://private-user-images.githubusercontent.com/146441689/378607132-aae6929e-60a2-4161-83aa-ff77ada420b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzUyODI5MzAsIm5iZiI6MTczNTI4MjYzMCwicGF0aCI6Ii8xNDY0NDE2ODkvMzc4NjA3MTMyLWFhZTY5MjllLTYwYTItNDE2MS04M2FhLWZmNzdhZGE0MjBiNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMjI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTIyN1QwNjU3MTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jOTdmMGJiNmZiNmI2Mzg4M2QzZWIwNDg2OGQ0MTdhZWEyYTcwNDFiMjBlZDAwN2RjNTUyNWJmMjQ0NTJhMzdhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.sTNF8HmXvfewgN3uh0P1C_cOCwNHaGVcAc7CR9-R_Dw)