]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/lib/job-queue/handlers/email.ts
Use bullmq job dependency
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / email.ts
1 import { Job } from 'bullmq'
2 import { EmailPayload } from '@shared/models'
3 import { logger } from '../../../helpers/logger'
4 import { Emailer } from '../../emailer'
5
6 async function processEmail (job: Job) {
7 const payload = job.data as EmailPayload
8 logger.info('Processing email in job %s.', job.id)
9
10 return Emailer.Instance.sendMail(payload)
11 }
12
13 // ---------------------------------------------------------------------------
14
15 export {
16 processEmail
17 }