Skip to content

Commit cd1d0ea

Browse files
committed
mensaje confirmacion de aprobacion vitalink a usuario
1 parent 5b29f3a commit cd1d0ea

7 files changed

Lines changed: 200 additions & 5 deletions

File tree

Vitalink V2.postman_collection.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
],
3434
"body": {
3535
"mode": "raw",
36-
"raw": "{\r\n \"email\": \"vitalinkcr2@gmail.com\",\r\n \"user_name\": null,\r\n \"password\": \"VitalinkCR2*\"\r\n}",
36+
"raw": "{\r\n \"email\": \"vitalink.crc@gmail.com\",\r\n \"user_name\": null,\r\n \"password\": \"VitalinkCR2*\"\r\n}",
3737
"options": {
3838
"raw": {
3939
"language": "json"

src/consts/Const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class ConstUrls{
1616
export class ConstTemplate{
1717
public static readonly SUPERADMIN_VALIDATION: string = "superadminValidation";
1818
public static readonly REGISTER_EMAIL: string = "registerEmail";
19+
public static readonly SUPER_ADMIN_REVIEW_USER: string = "superAdminReviewUser";
1920
public static readonly RECOVER_USER_EMAIL: string = "recoverUserByEmail";
2021
public static readonly FORGOT_PASSWORD_EMAIL: string = "forgotPasswordEmail";
2122
public static readonly GENERIC_TEMPLATE_EMAIL: string = "genericTemplateEmail";

src/data/json/emailMessages/emailMessages.en.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@
1414
"recoverUserByEmailMessage": "Recibimos una solicitud para recuperar su usuario para {{ companyName }}. Si no realizó esta solicitud, puede ignorar este correo.",
1515
"recoverUserByEmailLink": "Para recuperar su usuario, por favor haga clic en el siguiente enlace:",
1616

17-
"registerEmailSubject": "Verificacion de cuenta",
17+
"registerEmailSubject": "Verificación de cuenta",
1818
"registerEmailTitle": "Bienvenido a {{ companyName }}",
1919
"registerEmailMessage": "Gracias por registrarse en {{ companyName }}. Estamos emocionados de tenerle con nosotros.",
2020
"registerEmailLink": "Por favor, haga clic en el siguiente enlace para confirmar su registro:",
2121
"registerEmailConfirmation": "Confirmar Registro",
2222

23+
24+
"superAdminReviewUserSubject": "Verificación de Vitalink",
25+
"superAdminReviewUserTitle": "Bienvenido a {{ companyName }}",
26+
"superAdminReviewUserMessage": "{{ companyName }} ha verificado su cuenta.",
27+
"superAdminReviewUserLink": "Haga clic en el siguiente para ir a {{ companyName }}:",
28+
"superAdminReviewUserConfirmation": "Ir a {{ companyName }}",
29+
2330
"superadminValidationSubject": "Validación de Super Admin",
2431
"superadminValidationMessage": "El usuario {{ userName }} de role {{ userRole }} ha solicitado registrarse en la aplicacion.",
2532
"superadminValidationLink": "Por favor, haga clic en el siguiente enlace para confirmar su registro:",

src/data/json/emailMessages/emailMessages.es.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
"recoverUserByEmailMessage": "Recibimos una solicitud para recuperar su usuario para {{ companyName }}. Si no realizó esta solicitud, puede ignorar este correo.",
1515
"recoverUserByEmailLink": "Para recuperar su usuario, por favor haga clic en el siguiente enlace:",
1616

17-
"registerEmailSubject": "Verificacion de cuenta",
17+
"registerEmailSubject": "Verificación de cuenta",
1818
"registerEmailTitle": "Bienvenido a {{ companyName }}",
1919
"registerEmailMessage": "Gracias por registrarse en {{ companyName }}. Estamos emocionados de tenerle con nosotros.",
2020
"registerEmailLink": "Por favor, haga clic en el siguiente enlace para confirmar su registro:",
2121
"registerEmailConfirmation": "Confirmar Registro",
2222

23+
"superAdminReviewUserSubject": "Verificación de Vitalink",
24+
"superAdminReviewUserTitle": "Bienvenido a {{ companyName }}",
25+
"superAdminReviewUserMessage": "{{ companyName }} ha verificado su cuenta. Ahora puedes ingresar a nuestros servicios y disfrutar de todas las funcionalidades que ofrecemos.",
26+
"superAdminReviewUserLink": "Haga clic en el siguiente para ir a {{ companyName }}:",
27+
"superAdminReviewUserConfirmation": "Ir a {{ companyName }}",
28+
2329
"superadminValidationSubject": "Validación de Super Admin",
2430
"superadminValidationMessage": "El usuario {{ userName }} de role {{ userRole }} ha solicitado registrarse en la aplicacion.",
2531
"superadminValidationLink": "Por favor, haga clic en el siguiente enlace para confirmar su registro:",

src/modules/01_General/auth/controllers/AuthController.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,22 @@ async activeRegisterUserBySuperAdmin(reqHandler: RequestHandler){
283283

284284
await (this.getRepository() as UserRepository).update(user.id, user, reqHandler.getLogicalDelete());
285285

286-
// return "Activacion Completa";
286+
const variables = {
287+
userName: user.name,
288+
confirmationLink: config.COMPANY.LOGIN_URL
289+
};
290+
const htmlBody = await getEmailTemplate(ConstTemplate.SUPER_ADMIN_REVIEW_USER, user.language, variables);
291+
292+
const subject = getMessageEmail(ConstTemplate.SUPER_ADMIN_REVIEW_USER, user.language != null ? user.language : "es");
293+
const emailService = EmailService.getInstance();
294+
await emailService.sendEmail({
295+
toMail: [user.email],
296+
subject: subject,
297+
message: htmlBody,
298+
attachments: []
299+
});
300+
301+
287302

288303
return httpExec.successAction(null, ConstMessagesJson.SUPER_ADMIN_ACTIVATION);
289304

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<title>{{ superAdminReviewUserTitle }}</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
9+
<style type="text/css">
10+
body, table, td, a {
11+
-ms-text-size-adjust: 100%;
12+
-webkit-text-size-adjust: 100%;
13+
font-family: 'Poppins', sans-serif;
14+
font-size: 13px;
15+
font-weight: normal;
16+
}
17+
18+
table, td {
19+
mso-table-rspace: 0pt;
20+
mso-table-lspace: 0pt;
21+
}
22+
23+
img {
24+
-ms-interpolation-mode: bicubic;
25+
}
26+
27+
a[x-apple-data-detectors] {
28+
font-family: inherit !important;
29+
font-size: inherit !important;
30+
font-weight: inherit !important;
31+
line-height: inherit !important;
32+
color: inherit !important;
33+
text-decoration: none !important;
34+
}
35+
36+
div[style*="margin: 16px 0;"] {
37+
margin: 0 !important;
38+
}
39+
40+
body {
41+
width: 100% !important;
42+
height: 100% !important;
43+
padding: 0 !important;
44+
margin: 0 !important;
45+
}
46+
47+
table {
48+
border-collapse: collapse;
49+
}
50+
51+
a {
52+
color: mainColor;
53+
}
54+
55+
img {
56+
height: auto;
57+
line-height: 100%;
58+
text-decoration: none;
59+
border: 0;
60+
outline: none;
61+
}
62+
63+
.title {
64+
width: 100%;
65+
font-size: 18px;
66+
font-weight: 500;
67+
text-transform: uppercase;
68+
letter-spacing: 3px;
69+
text-align: center;
70+
height: 50px;
71+
line-height: 40px;
72+
color: mainColor;
73+
border-bottom: 1px solid #eee;
74+
}
75+
</style>
76+
</head>
77+
78+
<body style="background-color: backgroundColor; font-family: 'Poppins', sans-serif;">
79+
<div class="preheader" style="display: none; max-width: 0; max-height: 0; overflow: hidden; font-size: 1px; line-height: 1px; color: #fff; opacity: 0;">
80+
{{ superAdminReviewUserTitle }}
81+
</div>
82+
<table border="0" cellpadding="0" cellspacing="0" width="100%">
83+
84+
<tr>
85+
<td align="center" bgcolor="backgroundColor">
86+
87+
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;">
88+
<tr>
89+
<td align="center" valign="top" style="padding: 20px 10px;">
90+
<a href="{{ companyDomain }}">
91+
<img class="logo" src="{{ companyLogo }}" alt="Logo Vitalink" border="0" width="250" style="display: block; width: 250px; max-width: 250px; min-width: 250px;">
92+
</a>
93+
</td>
94+
</tr>
95+
</table>
96+
97+
</td>
98+
</tr>
99+
100+
<tr>
101+
<td align="center" bgcolor="backgroundColor">
102+
103+
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;position: relative;">
104+
105+
<tr style="max-width: 600px;">
106+
<td bgcolor="#ffffff" align="left" style="padding:0 24px 24px 24px; font-size: 15px;">
107+
<h1 class="title">
108+
{{ superAdminReviewUserTitle }}
109+
</h1>
110+
</td>
111+
</tr>
112+
113+
<tr style="max-width: 600px;">
114+
<td bgcolor="#ffffff" align="left" style="padding:0 24px 24px 24px; font-size: 15px;">
115+
<p style=" margin: 0;">{{ generalHello }}</p>
116+
<p></p>
117+
<p style=" margin: 0;">{{ superAdminReviewUserMessage }}</p>
118+
<p></p>
119+
<p style=" margin: 0;">{{ superAdminReviewUserLink }}</p>
120+
</td>
121+
</tr>
122+
123+
<tr style="max-width: 600px;">
124+
<td align="left" bgcolor="#ffffff">
125+
<table border="0" cellpadding="0" cellspacing="0" width="100%">
126+
<tr>
127+
<td align="center" bgcolor="#ffffff" style="padding: 20px;">
128+
<table border="0" cellpadding="0" cellspacing="0">
129+
<tr>
130+
<td align="center" bgcolor="mainColor" style="border-radius: 6px;">
131+
<a href="{{ confirmationLink }}" target="_blank" rel="noopener noreferrer" style="display: inline-block; padding: 15px 50px; font-size: 15px; font-weight: 600; color: #ffffff; text-decoration: none; border-radius: 6px;">&nbsp; {{ superAdminReviewUserTitle }} &nbsp;</a>
132+
</td>
133+
</tr>
134+
</table>
135+
</td>
136+
</tr>
137+
</table>
138+
</td>
139+
</tr>
140+
141+
<tr style="max-width: 600px;">
142+
<td align="left" bgcolor="#ffffff" style="padding: 24px; font-size: 15px; line-height: 24px; border-bottom: 5px solid mainColor">
143+
<p style=" margin: 0;">{{ generalQuestionContact }}</p>
144+
<p></p>
145+
<p style="margin: 0;">{{ generalRegards }}</p>
146+
<p style="margin: 0;">{{ generalSupport }}</p>
147+
</td>
148+
</tr>
149+
</table>
150+
</td>
151+
</tr>
152+
153+
<tr>
154+
<td align="center" bgcolor="backgroundColor" style="padding: 24px;">
155+
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;">
156+
<tr>
157+
<td align="center" bgcolor="backgroundColor" style="padding: 12px 24px; font-size: 14px; line-height: 20px; color: #666;">
158+
<p style="margin: 0;">{{ generalCopyright }}</p>
159+
</td>
160+
</tr>
161+
</table>
162+
</td>
163+
</tr>
164+
</table>
165+
</body>
166+
</html>

tenshi-config.dev.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"CUSTOMER_REGULAR_ROLE" : null
2323
},
2424
"SUPER_ADMIN":{
25-
"USER_EMAIL":"vitalinkcr2@gmail.com",
25+
"USER_EMAIL":"vitalink.crc@gmail.com",
2626
"PASSWORD":"VitalinkCR2*",
2727
"FIRST_NAME":"Vitalink",
2828
"LAST_NAME":"",

0 commit comments

Comments
 (0)