- const text = `Hi dear user,\n\n` +
- `A reset password procedure for your account ${to} has been requested on ${CONFIG.WEBSERVER.HOST} ` +
- `Please follow this link to reset it: ${resetPasswordUrl}\n\n` +
- `If you are not the person who initiated this request, please ignore this email.\n\n` +
- `Cheers,\n` +
- `PeerTube.`
+ const text = 'Hi dear user,\n\n' +
+ `A reset password procedure for your account ${to} has been requested on ${WEBSERVER.HOST} ` +
+ `Please follow this link to reset it: ${resetPasswordUrl} (the link will expire within 1 hour)\n\n` +
+ 'If you are not the person who initiated this request, please ignore this email.\n\n' +
+ 'Cheers,\n' +
+ `${CONFIG.EMAIL.BODY.SIGNATURE}`
+
+ const emailPayload: EmailPayload = {
+ to: [ to ],
+ subject: CONFIG.EMAIL.SUBJECT.PREFIX + 'Reset your password',
+ text
+ }
+
+ 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}`