Skip to content

Commit

Permalink
Merge pull request #7 from wandersonDeve/main
Browse files Browse the repository at this point in the history
feat: create response for user
  • Loading branch information
wandersonDeve authored Sep 3, 2023
2 parents 2dcf908 + 4186fb7 commit 8b8f415
Show file tree
Hide file tree
Showing 13 changed files with 2,180 additions and 1,343 deletions.
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
FROM node:18-alpine AS builder
FROM node:16-alpine AS builder

WORKDIR /user/app

COPY package.json ./

COPY prisma ./prisma/

RUN npm install

RUN npx prisma generate

COPY . .

RUN npm run build

FROM node:19-alpine
FROM node:16-alpine

COPY --from=builder /user/app/node_modules ./node_modules
COPY --from=builder /user/app/package*.json ./
Expand Down
3,257 changes: 1,987 additions & 1,270 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "",
"author": "",
"engine":{
"engine": {
"node": "18.x.x"
},
"private": true,
Expand Down Expand Up @@ -53,7 +53,6 @@
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.3.1",
"prettier": "^2.3.2",
"prisma": "^4.14.1",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.0.3",
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions prisma/migrations/20230519015426_add_row_name/migration.sql

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions prisma/migrations/migration_lock.toml

This file was deleted.

11 changes: 0 additions & 11 deletions prisma/schema.prisma

This file was deleted.

3 changes: 2 additions & 1 deletion src/modules/mails/send-mail.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Body, Controller, HttpCode, Post } from '@nestjs/common';
import { ApiOperation, ApiResponse } from '@nestjs/swagger';
import { ApiBody, ApiOperation, ApiResponse } from '@nestjs/swagger';
import { MailDTO } from 'src/shared/providers/mailer/dto/mail-dto';
import { SendMailService } from './send-mail.service';

Expand Down Expand Up @@ -39,6 +39,7 @@ export class SendMailController {
description: 'Error',
type: String,
})
@ApiBody({})
@Post('/collaborator')
@HttpCode(200)
async sendMail(@Body() data: any) {
Expand Down
17 changes: 15 additions & 2 deletions src/modules/mails/send-mail.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable } from '@nestjs/common';
import { MailProvider } from 'src/shared/providers/mailer/mailer-provider';
import { DataObjectDto } from '../../shared/providers/mailer/dto/mail-dto';

interface MailData {
[key: string]: string;
Expand All @@ -15,7 +14,7 @@ interface SendMailProps {
export class SendMailService {
constructor(private readonly mailProvider: MailProvider) {}

async send(data: DataObjectDto, subject: string): Promise<void> {
async send(data: any, subject: string): Promise<void> {
const { NODE_ENV, EMAIL_TESTE, EMAIL_PROD } = process.env;

const emailToSend = NODE_ENV === 'development' ? EMAIL_TESTE : EMAIL_PROD;
Expand All @@ -26,5 +25,19 @@ export class SendMailService {
template: './ombudsman',
to: emailToSend,
});

if (data.subject === 'Quero ser Mentor') {
await this.mailProvider.send({
context: {
CANDIDATE_FIRST_NAME: data?.name || 'Aquele que não deve ser nomeado',
JOB_NAME: data?.areas || '',
LINKEDIN_URL: data?.linkedin || '',
MESSAGE: data?.mensagem || '',
},
subject: 'Recebemos seu email',
template: './response-user',
to: data.email,
});
}
}
}
15 changes: 0 additions & 15 deletions src/prisma.service.ts

This file was deleted.

173 changes: 173 additions & 0 deletions src/shared/providers/mailer/templates/response-user.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<!DOCTYPE html>
<html
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
lang="pt-br">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0" /><!--[if mso
]><xml
><o:OfficeDocumentSettings
><o:PixelsPerInch>96</o:PixelsPerInch
><o:AllowPNG /></o:OfficeDocumentSettings></xml><!
[endif]-->/>
</head>

<style>
@media only screen and (min-width: 620px) {
*:not(p) {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 10px;
}
body {
width: 100%;
background-color: #f3f4f6;
font-family: Arial, Helvetica, sans-serif;
}
a[x-apple-data-detectors] {
color: inherit !important;
text-decoration: inherit !important;
}
p{
line-height: 24px;
}
.main {
width: 600px !important;
margin: 0 auto;
padding: 24px;
font-size: 1.6rem;
background-color: #fff;
}
.footer {
width: 600px !important;
margin: 0 auto;
background: linear-gradient(180deg, #006ad7 0%, #001957 100%);
padding: 24px 48px;
}
.space {
width: 48px;
display: block;
}
.icons-wrapper{
margin-bottom: 16px;
padding: 4px 0px;
}
.icons-wrapper img{
width: 40px;
padding: 0 4px;
margin-bottom: 8px;
display: inline-block;
}
.social-text{
font-size: inherit;
color: #FFF;
text-align: center;
font-family: inherit;
font-size: 1.6rem;
font-weight: 700;
}
}
</style>

<body>
<table class="main" cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td>
<p>Olá, {{FULL_NAME}}!</p>
<p>
Agradecemos seu interesse pela área {{JOB_NAME}}, seu perfil
passará por uma triagem. Caso você seja aprovado, aguarde as
próximas etapas através do e-mail cadastrado. Nos preocupamos em
te dar um retorno o mais rápido possível. Para isso, estamos
realizando a análise dos perfis com bastante atenção, e isso pode
levar alguns dias.
</p>
<p>Nome completo: {{FULL_NAME}}</p>
<p>Área de atuação:{{JOB_NAME}}</p>
<p>LinkedIn:{{LINKEDIN_URL}}</p>
<p
>Nos conte um pouco sobre você e por que gostaria de atuar na
SouJunior:{{MESSAGE}}</p
>
<p> Até breve com mais notícias, </p>
</td>
</tr>
</tbody>
</table>
<table class="footer">
<footer>
<tbody>
<tr>
<td>
<div class="red">
<img
src="https://www.soujunior.tech/assets/icons/Logo.svg"
alt="" />
</div>
</td>
<td class="space"></td>
<td>
<table>
<tr>
<td>
<p class="social-text">
Acompanhe nas redes
</p>
</td>
</tr>
<tr>
<td>
<table align="center">
<tr class="icons-wrapper">
<td>
<div class="span">
<img src="https://i.imgur.com/UixRb2I.png" alt="" />
<img src="https://i.imgur.com/Nnd2Rtg.png" alt="" />
<img src="https://i.imgur.com/YegGQWI.png" alt="" />
<img src="https://i.imgur.com/hSVasWD.png" alt="" />
<img src="https://i.imgur.com/565Ta6p.png" alt="" />
</div>
</td>
</tr>
<tr class="icons-wrapper">
<td align="center">
<div class="span">
<img src="https://i.imgur.com/OjLC6IY.png" alt="" />
<img src="https://i.imgur.com/Rq03nFd.png" alt="" />
<img src="https://i.imgur.com/6XOF6jH.png" alt="" />
<img src="https://i.imgur.com/XasnAki.png" alt="" />
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</footer>
</table>
</body>
</html>

0 comments on commit 8b8f415

Please sign in to comment.