Added endpoint

ref #5
This commit is contained in:
Nicolai Ort 2021-03-05 18:30:50 +01:00
parent 8da7c55deb
commit 9807e61fa8
1 changed files with 16 additions and 0 deletions

View File

@ -62,4 +62,20 @@ export class MailController {
}
return new SuccessResponse(locale);
}
@Post('/registration_forgot')
@OpenAPI({ description: "Sends selfservice link forgotten mails", parameters: [{ in: "query", name: "locale", schema: { type: "string", enum: ["de", "en"] } }] })
async sendSelfserviceForgotten(@Body({ validate: true }) mailOptions: WelcomeMail, @QueryParam("locale") locale: locales) {
if (!this.initialized) {
await this.mailer.init();
this.initialized = true;
}
try {
this.mailer.sendSelfserviceForgottenMail(mailOptions.address, mailOptions.selfserviceToken, locale?.toString())
} catch (error) {
console.log(error)
throw error;
}
return new SuccessResponse(locale);
}
}