1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Merge branch 'release/2.3.0' into develop

This commit is contained in:
Chocobozzz 2020-07-20 17:00:58 +02:00
commit ec903c010e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
22 changed files with 141 additions and 112 deletions

View file

@ -427,12 +427,13 @@ class Emailer {
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
}
addPasswordResetEmailJob (to: string, resetPasswordUrl: string) {
addPasswordResetEmailJob (username: string, to: string, resetPasswordUrl: string) {
const emailPayload: EmailPayload = {
template: 'password-reset',
to: [ to ],
subject: 'Reset your account password',
locals: {
username,
resetPasswordUrl
}
}
@ -454,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
}
}

View file

@ -5,8 +5,8 @@ block title
block content
p.
A reset password procedure for your account ${to} has been requested on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}].
Please follow #[a(href=resetPasswordUrl) this link] to reset it: #[a(href=resetPasswordUrl) #{resetPasswordUrl}]
A reset password procedure for your account #{username} has been requested on #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}].
Please follow #[a(href=resetPasswordUrl) this link] to reset it: #[a(href=resetPasswordUrl) #{resetPasswordUrl}]
(the link will expire within 1 hour)
p.
If you are not the person who initiated this request, please ignore this email.
If you are not the person who initiated this request, please ignore this email.

View file

@ -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)
}
// ---------------------------------------------------------------------------