2020-06-03 14:14:42 +02:00
|
|
|
import {Request, Response} from "express";
|
2021-05-03 19:29:22 +02:00
|
|
|
|
|
|
|
import Controller from "../Controller.js";
|
2020-06-03 14:14:42 +02:00
|
|
|
|
|
|
|
export default class MailController extends Controller {
|
2020-09-25 23:42:15 +02:00
|
|
|
public routes(): void {
|
2020-07-15 11:42:49 +02:00
|
|
|
this.get("/mail/:template", this.getMail, 'mail');
|
2020-06-03 14:14:42 +02:00
|
|
|
}
|
|
|
|
|
2021-11-28 21:26:45 +01:00
|
|
|
protected async getMail(request: Request, res: Response): Promise<void> {
|
2020-06-03 14:14:42 +02:00
|
|
|
const template = request.params['template'];
|
2021-11-28 21:26:45 +01:00
|
|
|
res.formatViewData(`mails/${template}.mnjk`, request.query);
|
2020-06-03 14:14:42 +02:00
|
|
|
}
|
2020-09-25 23:42:15 +02:00
|
|
|
}
|