- addPasswordResetEmailJob (to: string, resetPasswordUrl: string) {
- 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}\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 })
- }
-
- addVerifyEmailJob (to: string, verifyEmailUrl: string) {
- const text = `Welcome to PeerTube,\n\n` +
- `To start using PeerTube on ${WEBSERVER.HOST} you must verify your email! ` +
- `Please follow this link to verify this email belongs to you: ${verifyEmailUrl}\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 + 'Verify your email',
- text
- }
-
- return JobQueue.Instance.createJob({ type: 'email', payload: emailPayload })
+ private warnOnConnectionFailure (err?: Error) {
+ logger.error('Failed to connect to SMTP %s:%d.', CONFIG.SMTP.HOSTNAME, CONFIG.SMTP.PORT, { err })