1
0
Fork 0
peertube/server/lib/job-queue/handlers/email.ts

19 lines
478 B
TypeScript
Raw Normal View History

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