This commit is contained in:
Bastian Wagner
2026-06-09 09:45:33 +02:00
commit 537c7cbbee
124 changed files with 27283 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { Injectable, Logger } from '@nestjs/common';
import { SentEmail } from './mail.types';
@Injectable()
export class MailService {
private readonly logger = new Logger(MailService.name);
private readonly sentEmails: SentEmail[] = [];
sendVerificationEmail(to: string, verificationUrl: string): void {
const email: SentEmail = {
to,
subject: 'Verify your Listify account',
text: `Please verify your account by opening this link: ${verificationUrl}`,
verificationUrl,
};
this.sentEmails.push(email);
this.logger.log(
`Verification email sent to ${to}: ${email.verificationUrl}`,
);
}
getSentEmails(): SentEmail[] {
return [...this.sentEmails];
}
}