1
0
Fork 0
peertube/server/lib/job-queue/handlers/email.ts
Chocobozzz dee77e767f
Create send email type
Instead of using email job handler payload type
2019-02-20 15:54:32 +01:00

18 lines
478 B
TypeScript

import * as Bull from 'bull'
import { logger } from '../../../helpers/logger'
import { Emailer, SendEmailOptions } from '../../emailer'
export type EmailPayload = SendEmailOptions
async function processEmail (job: Bull.Job) {
const payload = job.data as EmailPayload
logger.info('Processing email in job %d.', job.id)
return Emailer.Instance.sendMail(payload)
}
// ---------------------------------------------------------------------------
export {
processEmail
}