aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/lib/job-queue/handlers/email.ts
blob: 567bcc076b62eed662b7ac7f45855315d847aa05 (plain) (tree)
1
2
3
4
5
6
7
8
9
                            
                                             
                                                
                                       
 
                                        
                                          
                                                    
 
                                           






                                                                              
import { Job } from 'bullmq'
import { EmailPayload } from '@shared/models'
import { logger } from '../../../helpers/logger'
import { Emailer } from '../../emailer'

async function processEmail (job: Job) {
  const payload = job.data as EmailPayload
  logger.info('Processing email in job %s.', job.id)

  return Emailer.Instance.sendMail(payload)
}

// ---------------------------------------------------------------------------

export {
  processEmail
}