Closes #237
Added a new function in ProfileForm.tsx called updatePreferencesInDB which takes the changed data from the checkbox and edits that users preferences. We then added if statements in all the sendEmail function calls within events/controllers.ts and users/controllers.ts to check if the user's email notifications are on or off. It only sends the email if the user's notifications are on.
Testing
I used my log in and selected that I did not want email notifications and then I registered for an event. I did not receive an email so it appears to be working.
Summary
Closes #237 Added a new function in ProfileForm.tsx called updatePreferencesInDB which takes the changed data from the checkbox and edits that users preferences. We then added if statements in all the sendEmail function calls within events/controllers.ts and users/controllers.ts to check if the user's email notifications are on or off. It only sends the email if the user's notifications are on.
Testing
I used my log in and selected that I did not want email notifications and then I registered for an event. I did not receive an email so it appears to be working.