Skip to content

Conversation

@charred-70
Copy link
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
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
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
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

});
}

await membershipConfirmationCode(USER, req.body.recipientEmail, req.body.confirmationCode)
Copy link
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)

})
.catch((err) => {
logger.error('unable to send confirmation code: ', err);
res.sendStatus(BAD_REQUEST);
Copy link
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 on lines 180 to 181
logger.error('unable to send member confirmation email: ', err);
res.sendStatus(BAD_REQUEST);
Copy link
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);

Copy link
Contributor

@adarshm11 adarshm11 left a comment

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
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.

3 participants