Se corrigió envio de correos y creacion de controller servicio

This commit is contained in:
2025-10-21 14:54:31 -06:00
parent 86b0096350
commit de24bdeec0
11 changed files with 709 additions and 432 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ import { Usuario } from 'src/usuario/entities/usuario.entity';
import { ValidacionService } from 'src/helpers.services/validacion.service';
import { AuthService } from 'src/auth/auth.service';
import { gmail } from 'src/helpers.services/gmail.service';
import { SendCorreoDto } from 'src/helpers.services/dto/send-email.dto';
import { SendMailDto } from 'src/helpers.services/dto/send-email.dto';
@Injectable()
export class ProgramaService {
@@ -83,11 +83,11 @@ export class ProgramaService {
},
});
const sendCorreoDto: SendCorreoDto = {
const sendCorreoDto: SendMailDto = {
to: prog.correo,
subject: correoInfo.subject,
text: correoInfo.msj,
html: '',
fecha_recibido: new Date(),
};
if (!process.env.TOKEN_GMAIL) {
@@ -97,7 +97,7 @@ export class ProgramaService {
try {
responsable = await this.usuarioRepo.save(responsable);
await this.gmail.sendMail(sendCorreoDto);
await this.gmail.enviarCorreo(sendCorreoDto);
mensaje += `Responsable creado con ID ${responsable.idUsuario} y correo ${responsable.usuario}\n`;
} catch (err) {
mensaje += `Error creando responsable: ${err.message}\n`;