]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/lib/job-queue/handlers/email.ts
Import magnets with webtorrent
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / email.ts
1 import * as Bull from 'bull'
2 import { logger } from '../../../helpers/logger'
3 import { Emailer } from '../../emailer'
4
5 export type EmailPayload = {
6 to: string[]
7 subject: string
8 text: string
9 }
10
11 async function processEmail (job: Bull.Job) {
12 const payload = job.data as EmailPayload
13 logger.info('Processing email in job %d.', job.id)
14
15 return Emailer.Instance.sendMail(payload.to, payload.subject, payload.text)
16 }
17
18 // ---------------------------------------------------------------------------
19
20 export {
21 processEmail
22 }