31 lines
819 B
TypeScript
31 lines
819 B
TypeScript
// src/excel/excel.controller.ts
|
|
import { Controller, Post, Get, UseGuards, Request, Res, UploadedFile, UseInterceptors, HttpStatus, Param, ParseIntPipe, Body } from '@nestjs/common';
|
|
import { SendCorreoDto } from './dto/send-email.dto';
|
|
import { MailService } from './mail.service';
|
|
|
|
|
|
@Controller('mail')
|
|
export class MailController {
|
|
constructor(
|
|
private readonly mailService: MailService
|
|
) { }
|
|
|
|
@Post('send')
|
|
async sendMail(@Body() body: SendCorreoDto) {
|
|
const result =
|
|
await this.mailService.sendMail(body)
|
|
.then((value) => {
|
|
console.log("Se mandaron los correos", value);
|
|
|
|
})
|
|
.catch((err) => {
|
|
console.log(err)
|
|
})
|
|
|
|
|
|
// sistem
|
|
return result;
|
|
|
|
|
|
}
|
|
} |