PeerTube/server/lib/job-queue/handlers/email.ts

18 lines
461 B
TypeScript
Raw Normal View History

2018-07-10 17:02:20 +02:00
import * as Bull from 'bull'
2018-01-30 13:27:07 +01:00
import { logger } from '../../../helpers/logger'
2020-04-23 09:32:53 +02:00
import { Emailer } from '../../emailer'
import { EmailPayload } from '@shared/models'
2018-01-30 13:27:07 +01:00
2018-07-10 17:02:20 +02:00
async function processEmail (job: Bull.Job) {
2018-01-30 13:27:07 +01:00
const payload = job.data as EmailPayload
logger.info('Processing email in job %d.', job.id)
2019-02-14 11:56:23 +01:00
return Emailer.Instance.sendMail(payload)
2018-01-30 13:27:07 +01:00
}
// ---------------------------------------------------------------------------
export {
processEmail
}