]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/job-queue/handlers/email.ts
Fix from header in contact form
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / email.ts
CommitLineData
94831479 1import * as Bull from 'bull'
ecb4e35f
C
2import { logger } from '../../../helpers/logger'
3import { Emailer } from '../../emailer'
4
5export type EmailPayload = {
6 to: string[]
7 subject: string
8 text: string
7a338188
C
9
10 fromDisplayName?: string
11 replyTo?: string
ecb4e35f
C
12}
13
94831479 14async function processEmail (job: Bull.Job) {
ecb4e35f
C
15 const payload = job.data as EmailPayload
16 logger.info('Processing email in job %d.', job.id)
17
7a338188 18 return Emailer.Instance.sendMail(payload)
ecb4e35f
C
19}
20
21// ---------------------------------------------------------------------------
22
23export {
24 processEmail
25}