Update nodemailer to use patient email as recipient and add toasts when email is sent. #97
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.
Description
I changed both the request and confirmed emails to use the email provided by the patient as the recipient email instead of using the email that is being used in the local.env file for the sender. I also added a toast to display once the email is successfully sent. I adjusted the TOAST_LIMIT in use_toast.ts from 1 to 2 so that the email toast would display under the success toasts when a form is submitted or an appointment is confirmed. I did not add a toast if there is an error with the email, but I can easily do it if we would like to have that.
Related Issue
closes #79
Acceptance Criteria
Have email entered by patient be the email address be where the email is sent to instead of using the default email set up as the sender.
Type of Changes
Testing Steps / QA Criteria
To test request emails: Using one of the two new links for the appointment form (http://localhost:3000/appointment/pure-smiles-dentistry or http://localhost:3000/appointment/pearly-whites), fill out the form using a real email address where you would like to receive the email. Once the form is successfully submitted and that toast appears, another toast should appear informing you that the email was successfully sent to the email provided. An email should appear in that inbox with all the appointment details.
To test confirmation emails: Log into the appropriate admin account depending on which form you used (using either admin@admin.com or donjoe@gmail.com). Click on the appointment you just created and confirm the appointment. Once the toast appears that says if the appointment has been confirmed, another toast should appear informing you that the email was successfully sent to the email of the patient provided. An email should appear in that inbox with all the confirmed appointment details.