mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Creating a user with an empty password will send an email to let him set his password (#2479)
* Creating a user with an empty password will send an email to let him set his password * Consideration of Chocobozzz's comments * Tips for optional password * API documentation * Fix circular imports * Tests
This commit is contained in:
parent
c5621bd23b
commit
45f1bd72a0
14 changed files with 201 additions and 18 deletions
|
@ -384,6 +384,22 @@ class Emailer {
|
|||
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
|
||||
}
|
||||
|
||||
addPasswordCreateEmailJob (username: string, to: string, resetPasswordUrl: string) {
|
||||
const text = 'Hi,\n\n' +
|
||||
`Welcome to your ${WEBSERVER.HOST} PeerTube instance. Your username is: ${username}.\n\n` +
|
||||
`Please set your password by following this link: ${resetPasswordUrl} (this link will expire within seven days).\n\n` +
|
||||
'Cheers,\n' +
|
||||
`${CONFIG.EMAIL.BODY.SIGNATURE}`
|
||||
|
||||
const emailPayload: EmailPayload = {
|
||||
to: [ to ],
|
||||
subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New PeerTube account password',
|
||||
text
|
||||
}
|
||||
|
||||
return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
|
||||
}
|
||||
|
||||
addVerifyEmailJob (to: string, verifyEmailUrl: string) {
|
||||
const text = 'Welcome to PeerTube,\n\n' +
|
||||
`To start using PeerTube on ${WEBSERVER.HOST} you must verify your email! ` +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue