Se corrigió envio de correos y creacion de controller servicio
This commit is contained in:
@@ -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`;
|
||||
|
||||
Reference in New Issue
Block a user