Skip to content

Commit

Permalink
add news config to email e envs links
Browse files Browse the repository at this point in the history
  • Loading branch information
wouerner committed Jun 28, 2024
1 parent ba9ef78 commit 5638fc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/modules/mails/mail.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ import { MailService } from './mail.service';
transport: {
host: config.get('MAIL_HOST'),
port: config.get('MAIL_PORT'),
secure: true,
// secure: true,
// secure: false,
auth: {
user: config.get('MAIL_USER'),
pass: config.get('MAIL_PASSWORD'),
},
tls: {
rejectUnauthorized: false,
},
// tls: {
// rejectUnauthorized: false,
// },
},
defaults: {
from: `no-reply <[email protected]>`,
from: `no-reply <[email protected]>`,
},
template: {
dir: join(__dirname, 'templates'),
Expand Down
11 changes: 7 additions & 4 deletions src/modules/mails/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export class MailService {

async sendUserConfirmation(user: UsersEntity): Promise<void> {
const { email, name, recoverPasswordToken } = user;
const url = `https://vagas-front-end.netlify.app/recovery-password?token=${recoverPasswordToken}&type=USER`;
// const url = `https://vagas-front-end.netlify.app/recovery-password?token=${recoverPasswordToken}&type=USER`;
const url = `${process.env.FRONTEND_URL}/recovery-password?token=${recoverPasswordToken}&type=USER`;



if (recoverPasswordToken) {
await this.mailerService.sendMail({
Expand Down Expand Up @@ -37,7 +40,7 @@ export class MailService {
async sendUserCreationConfirmation(user: UsersEntity) {
const { email, name, id } = user;

const url = `https://vagas-front-end.netlify.app/userconfirmation?id=${id}&type=USER`;
const url = `${process.env.FRONTEND_URL}/userconfirmation?id=${id}&type=USER`;

await this.mailerService.sendMail({
to: email,
Expand All @@ -54,7 +57,7 @@ export class MailService {

async sendCompanyConfirmation(company: CompaniesEntity) {
const { email, companyName, recoverPasswordToken } = company;
const url = `https://vagas-front-end.netlify.app/recovery-password?token=${recoverPasswordToken}&type=COMPANY`;
const url = `${process.env.FRONTEND_URL}/recovery-password?token=${recoverPasswordToken}&type=COMPANY`;

if (recoverPasswordToken) {
await this.mailerService.sendMail({
Expand All @@ -81,7 +84,7 @@ export class MailService {
async sendCompanyCreationConfirmation(company: CompaniesEntity) {
const { email, companyName, id } = company;

const url = `https://vagas-front-end.netlify.app/companyconfirmation?id=${id}&type=COMPANY`;
const url = `${process.env.FRONTEND_URL}/companyconfirmation?id=${id}&type=COMPANY`;

await this.mailerService.sendMail({
to: email,
Expand Down

0 comments on commit 5638fc1

Please sign in to comment.