2022-08-08 03:42:08 -05:00
|
|
|
import { Job } from 'bullmq'
|
2023-07-31 07:34:36 -05:00
|
|
|
import { EmailPayload } from '@peertube/peertube-models'
|
|
|
|
import { logger } from '../../../helpers/logger.js'
|
|
|
|
import { Emailer } from '../../emailer.js'
|
2018-01-30 06:27:07 -06:00
|
|
|
|
2024-09-05 08:43:43 -05:00
|
|
|
export function processEmail (job: Job) {
|
2018-01-30 06:27:07 -06:00
|
|
|
const payload = job.data as EmailPayload
|
2022-08-08 08:48:17 -05:00
|
|
|
logger.info('Processing email in job %s.', job.id)
|
2018-01-30 06:27:07 -06:00
|
|
|
|
2019-02-14 04:56:23 -06:00
|
|
|
return Emailer.Instance.sendMail(payload)
|
2018-01-30 06:27:07 -06:00
|
|
|
}
|