diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-30 13:27:07 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-30 13:27:07 +0100 |
commit | ecb4e35f4e6c7304cb274593c13cb47fd5078b75 (patch) | |
tree | 1e238002340bc521afde59d52f406e41298a7aac /server/lib/job-queue/handlers | |
parent | 80d1057bfcd3582af0dacf5ccd5a7a93ef95410b (diff) | |
download | PeerTube-ecb4e35f4e6c7304cb274593c13cb47fd5078b75.tar.gz PeerTube-ecb4e35f4e6c7304cb274593c13cb47fd5078b75.tar.zst PeerTube-ecb4e35f4e6c7304cb274593c13cb47fd5078b75.zip |
Add ability to reset our password
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/email.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/lib/job-queue/handlers/email.ts b/server/lib/job-queue/handlers/email.ts new file mode 100644 index 000000000..9d7686116 --- /dev/null +++ b/server/lib/job-queue/handlers/email.ts | |||
@@ -0,0 +1,22 @@ | |||
1 | import * as kue from 'kue' | ||
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: kue.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 | } | ||