17 lines
424 B
TypeScript
17 lines
424 B
TypeScript
import { Body, Controller, Post } from '@nestjs/common';
|
|
import { MailService } from './mail.service';
|
|
|
|
@Controller('mail')
|
|
export class MailController {
|
|
constructor(private readonly mailService: MailService) {}
|
|
|
|
@Post()
|
|
async sendTestEmail(@Body() body: { email: string }) {
|
|
const { email } = body;
|
|
return this.mailService.sendMail(
|
|
email,
|
|
'Test Email',
|
|
'This is a test email.',
|
|
);
|
|
}
|
|
} |