Skip to content

created route to email users their confirmation code #1997

Merged
adarshm11 merged 5 commits into
pending-paymentfrom
confirmation-route
Jan 12, 2026
Merged

created route to email users their confirmation code #1997
adarshm11 merged 5 commits into
pending-paymentfrom
confirmation-route

Conversation

@charred-70

Copy link
Copy Markdown
Contributor

for issue #1987

created a simple email template and route to send confirmation codes

Comment on lines +2 to +4
if (!confirmCode) {
throw new Error('Confirmation code is required');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to check this because the route already checks it

throw new Error('Confirmation code is required');
}

return {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +14 to +16
Thank you for signing up for membership! <br />
Here is your confirmation code:</p>
<b>${confirmCode}</b>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread api/cloud_api/routes/Mailer.js Outdated
});
}

await membershipConfirmationCode(USER, req.body.recipientEmail, req.body.confirmationCode)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await membershipConfirmationCode(USER, req.body.recipientEmail, req.body.confirmationCode)
await membershipConfirmationCode(USER, recipientEmail, confirmationCode)

Comment thread api/cloud_api/routes/Mailer.js Outdated
})
.catch((err) => {
logger.error('unable to send confirmation code: ', err);
res.sendStatus(BAD_REQUEST);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment thread api/cloud_api/routes/Mailer.js Outdated
Comment on lines +180 to +181
logger.error('unable to send member confirmation email: ', err);
res.sendStatus(BAD_REQUEST);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);

Comment thread api/cloud_api/routes/Mailer.js

@adarshm11 adarshm11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent

@adarshm11
adarshm11 changed the base branch from dev to pending-payment January 12, 2026 22:48
@adarshm11
adarshm11 merged commit c6805be into pending-payment Jan 12, 2026
7 of 8 checks passed
@adarshm11
adarshm11 deleted the confirmation-route branch January 12, 2026 22:48
adarshm11 added a commit that referenced this pull request Jan 27, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants