Skip to content

Commit

Permalink
Add username for verify-email notif
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsible committed Jul 15, 2020
1 parent 9016676 commit 288d338
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion server/lib/emailer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,12 +455,13 @@ class Emailer {
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
}

addVerifyEmailJob (to: string, verifyEmailUrl: string) {
addVerifyEmailJob(username: string, to: string, verifyEmailUrl: string) {
const emailPayload: EmailPayload = {
template: 'verify-email',
to: [ to ],
subject: `Verify your email on ${WEBSERVER.HOST}`,
locals: {
username,
verifyEmailUrl
}
}
Expand Down
3 changes: 2 additions & 1 deletion server/lib/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ async function sendVerifyUserEmail (user: MUser, isPendingEmail = false) {
if (isPendingEmail) url += '&isPendingEmail=true'

const email = isPendingEmail ? user.pendingEmail : user.email
const username = user.username

await Emailer.Instance.addVerifyEmailJob(email, url)
await Emailer.Instance.addVerifyEmailJob(username, email, url)
}

// ---------------------------------------------------------------------------
Expand Down

0 comments on commit 288d338

Please sign in to comment.