Mailservice

This commit is contained in:
Bastian Wagner
2025-01-20 13:17:00 +01:00
parent abb703f592
commit add2fd0240
19 changed files with 3071 additions and 67 deletions

View File

@@ -0,0 +1,37 @@
import { Injectable } from '@nestjs/common';
import { EmailLogRepository } from 'src/model/repositories/log';
@Injectable()
export class LogService {
constructor(private readonly emailLogRepo: EmailLogRepository) {}
log(type: LogType, data: any) {
if (type == LogType.Mail) {
return this.logEmail(data);
}
}
private async logEmail(data: EmailLogDto) {
const log = this.emailLogRepo.create(data);
const logEntry = await this.emailLogRepo.save(log);
console.log(logEntry);
}
}
export enum LogType {
Mail
}
export enum EmailEvent {
GrantSystemAccess,
RemoveSystemAccess
}
export interface EmailLogDto {
success: boolean;
message: string;
to: string;
type: EmailEvent;
}