This PR enables the Nodemailer email service on the website contact form.
Describe the changes you've made to resolve the issue
Modified the pages/api/contact.ts file to reflect the api_four.js file from the tutorial (link is added as a comment for future reference)
The original tutorial code suggested a switch/case scenario to account for multiple HTTP request types.
@YolineB and I took a look and were wondering if an if/else statement would suffice since this route would likely just use a POST method and not the other request types.
Added service/mailService.js that holds the email transporter function.
Add screenshots of the UI before and after your changes have been made
No UI changes were made with this PR.
UI with sample inputs before email sent:
Email received:
Additional Notes
Hoping to address unit tests / add to the existing Jest tests a separate PR.
Code Review Checklist
[x] Have the package.json or package-lock.json been changed? If so, does the pull request description say why?
[ ] Has the UI for mobile and desktop been changed, did you test on IphoneXr and desktop views?
[ ] Does the UI match the requirements in the ticket and designs in figma; does it pass the visual smell test?
[ ] Have TypeScript files been changed, does the TypeScript pass the smell test?
[ ] If you don't feel super confident in your review, did you assign someone more senior to double check?
Pull Request Process
Describe the issue you are trying to resolve
This PR enables the
Nodemailer
email service on the website contact form.Describe the changes you've made to resolve the issue
pages/api/contact.ts
file to reflect theapi_four.js
file from the tutorial (link is added as a comment for future reference)The original tutorial code suggested a switch/case scenario to account for multiple HTTP request types.
@YolineB and I took a look and were wondering if an if/else statement would suffice since this route would likely just use a
POST
method and not the other request types.service/mailService.js
that holds the email transporter function.Add screenshots of the UI before and after your changes have been made
No UI changes were made with this PR.
UI with sample inputs before email sent:
Email received:
Additional Notes
Hoping to address unit tests / add to the existing Jest tests a separate PR.
Code Review Checklist