created route to email users their confirmation code #1997
Conversation
| if (!confirmCode) { | ||
| throw new Error('Confirmation code is required'); | ||
| } |
There was a problem hiding this comment.
we don't need to check this because the route already checks it
| throw new Error('Confirmation code is required'); | ||
| } | ||
|
|
||
| return { |
There was a problem hiding this comment.
can we wrap the return statement in a Promise, we should also reject the Promise if we catch an error, see unsubscribeEmail.js to see how to resolve/reject the Promise
| Thank you for signing up for membership! <br /> | ||
| Here is your confirmation code:</p> | ||
| <b>${confirmCode}</b> |
There was a problem hiding this comment.
include instructions about how they should confirm their membership, like "login to the SCE website and visit your profile to verify your membership" or something
| }); | ||
| } | ||
|
|
||
| await membershipConfirmationCode(USER, req.body.recipientEmail, req.body.confirmationCode) |
There was a problem hiding this comment.
| await membershipConfirmationCode(USER, req.body.recipientEmail, req.body.confirmationCode) | |
| await membershipConfirmationCode(USER, recipientEmail, confirmationCode) |
| }) | ||
| .catch((err) => { | ||
| logger.error('unable to send confirmation code: ', err); | ||
| res.sendStatus(BAD_REQUEST); |
There was a problem hiding this comment.
| res.sendStatus(BAD_REQUEST); | |
| res.sendStatus(SERVER_ERROR); |
and make sure to import this status code at the top too. i know the other routes return bad request for failures but that's wrong
| logger.error('unable to send member confirmation email: ', err); | ||
| res.sendStatus(BAD_REQUEST); |
There was a problem hiding this comment.
| logger.error('unable to send member confirmation email: ', err); | |
| res.sendStatus(BAD_REQUEST); | |
| logger.error('unable to generate member confirmation email template: ', err); | |
| res.sendStatus(SERVER_ERROR); |
* added membership payment schema * revised spacing * Update api/main_endpoints/models/MembershipPayment.js Co-authored-by: adarsh <110150037+adarshm11@users.noreply.github.com> * fixed syntax * Update api/main_endpoints/models/MembershipPayment.js * Update api/main_endpoints/models/MembershipPayment.js * Emily/20250104 handle membership payment confirmation (#1993) * initial commit * fixed spacing * fixed spacing 2 * fixed spacing 2 * updated logic and merged find and Verify functions * fix spacing * refactor: improve payment verification and rejection logic * fix * refactor: improve error handling in membership payment verification and rejection * fix * final fixes * final fixes * refactored updateMembershipExpiration * fix spacing * created route to email users their confirmation code (#1997) * i pray i fixed my origin * added instructions * fixed import error * fixed template formatting * made function to call email route --------- Co-authored-by: Charlynn Nguyen <charred@Charlynns-MacBook-Pro.local> * allow users to verify membership on profile (#2000) * verify-button-test-1 * fix lint * route to store new payments from gscript * payerEmail not memberEmail * import error * add logging to verifyMembership route * revise how payments are stored * bruh * dont run validators * plz work * js moment * ai * silly * return status for email send failure * evan ugarte * evan ugarte i will find you * evan ugarte you silly little chud * evan ugarte is NOT a chud <3 * tell these chuds how to pay --------- Co-authored-by: Tiffany Tran <167036717+Tyffoni@users.noreply.github.com> Co-authored-by: adarsh <110150037+adarshm11@users.noreply.github.com> Co-authored-by: Emily <162777193+codebyemily@users.noreply.github.com> Co-authored-by: Charlynn Nguyen <129462659+charred-70@users.noreply.github.com> Co-authored-by: Charlynn Nguyen <charred@Charlynns-MacBook-Pro.local> Co-authored-by: Alina Ly <alinaly.625@gmail.com> Co-authored-by: adarshm11 <amlearning2023@gmail.com>
for issue #1987
created a simple email template and route to send confirmation codes