diff options
Diffstat (limited to 'server/lib/emailer.ts')
-rw-r--r-- | server/lib/emailer.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 9ce6186b1..0f74d2a8c 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts | |||
@@ -384,6 +384,22 @@ class Emailer { | |||
384 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) | 384 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) |
385 | } | 385 | } |
386 | 386 | ||
387 | addPasswordCreateEmailJob (username: string, to: string, resetPasswordUrl: string) { | ||
388 | const text = 'Hi,\n\n' + | ||
389 | `Welcome to your ${WEBSERVER.HOST} PeerTube instance. Your username is: ${username}.\n\n` + | ||
390 | `Please set your password by following this link: ${resetPasswordUrl} (this link will expire within seven days).\n\n` + | ||
391 | 'Cheers,\n' + | ||
392 | `${CONFIG.EMAIL.BODY.SIGNATURE}` | ||
393 | |||
394 | const emailPayload: EmailPayload = { | ||
395 | to: [ to ], | ||
396 | subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'New PeerTube account password', | ||
397 | text | ||
398 | } | ||
399 | |||
400 | return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload }) | ||
401 | } | ||
402 | |||
387 | addVerifyEmailJob (to: string, verifyEmailUrl: string) { | 403 | addVerifyEmailJob (to: string, verifyEmailUrl: string) { |
388 | const text = 'Welcome to PeerTube,\n\n' + | 404 | const text = 'Welcome to PeerTube,\n\n' + |
389 | `To start using PeerTube on ${WEBSERVER.HOST} you must verify your email! ` + | 405 | `To start using PeerTube on ${WEBSERVER.HOST} you must verify your email! ` + |