base con autenticacion, registro, modulo encuestas
This commit is contained in:
11
apps/api/src/features/mail/mail.module.ts
Normal file
11
apps/api/src/features/mail/mail.module.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { MailerModule } from '@nestjs-modules/mailer';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { MailService } from './mail.service';
|
||||
|
||||
@Module({
|
||||
imports: [MailerModule, ConfigModule],
|
||||
providers: [MailService],
|
||||
exports: [MailService],
|
||||
})
|
||||
export class MailModule {}
|
||||
18
apps/api/src/features/mail/mail.service.spec.ts
Normal file
18
apps/api/src/features/mail/mail.service.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { MailService } from './mail.service';
|
||||
|
||||
describe('MailService', () => {
|
||||
let service: MailService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [MailService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<MailService>(MailService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
18
apps/api/src/features/mail/mail.service.ts
Normal file
18
apps/api/src/features/mail/mail.service.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ISendMailOptions, MailerService } from '@nestjs-modules/mailer';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
@Injectable()
|
||||
export class MailService {
|
||||
constructor(
|
||||
private readonly mailerService: MailerService,
|
||||
private readonly config: ConfigService,
|
||||
) {}
|
||||
|
||||
async sendEmail(mailOptions: ISendMailOptions): Promise<void> {
|
||||
await this.mailerService.sendMail({
|
||||
from: `Turbo NPN <${this.config.get('MAIL_USERNAME')}>`,
|
||||
...mailOptions,
|
||||
});
|
||||
}
|
||||
}
|
||||
177
apps/api/src/features/mail/templates/change-password.mail.ts
Normal file
177
apps/api/src/features/mail/templates/change-password.mail.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
const ChangePasswordMail = ({ name }: { name: string }) => {
|
||||
return `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
</head>
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
line-height: 1px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
max-width: 0;
|
||||
"
|
||||
>
|
||||
Join Turbo NPN
|
||||
</div>
|
||||
<body
|
||||
style="
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
"
|
||||
>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
border-radius: 0.25rem;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 40px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 20px;
|
||||
max-width: 465px;
|
||||
"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="margin-top: 32px"
|
||||
>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
alt="Vercel"
|
||||
height="37"
|
||||
src="https://react-email-demo-2jmpohtxd-resend.vercel.app/static/vercel-logo.png"
|
||||
style="
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
"
|
||||
width="40"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h1
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
"
|
||||
>
|
||||
<strong>Turbo NPN</strong>
|
||||
</h1>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Hello, ${name}
|
||||
</p>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Turbo NPN send your sign in notification email
|
||||
</p>
|
||||
<div style="display: flex;justify-content: center; align-items: center;">
|
||||
<p
|
||||
style="
|
||||
background-color: rgb(0, 0, 0);
|
||||
border-radius: 0.25rem;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
"
|
||||
>
|
||||
New Sign In Detected
|
||||
</p>
|
||||
</div>
|
||||
<hr
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
margin-top: 26px;
|
||||
margin-bottom: 26px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
color: rgb(102, 102, 102);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
Turbo NPN is a free and open source prodcut
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
};
|
||||
|
||||
export default ChangePasswordMail;
|
||||
177
apps/api/src/features/mail/templates/confirm-email.mail.ts
Normal file
177
apps/api/src/features/mail/templates/confirm-email.mail.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
const SignInMail = ({ name }: { name: string }) => {
|
||||
return `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
</head>
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
line-height: 1px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
max-width: 0;
|
||||
"
|
||||
>
|
||||
Join Turbo NPN
|
||||
</div>
|
||||
<body
|
||||
style="
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
"
|
||||
>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
border-radius: 0.25rem;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 40px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 20px;
|
||||
max-width: 465px;
|
||||
"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="margin-top: 32px"
|
||||
>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
alt="Vercel"
|
||||
height="37"
|
||||
src="https://react-email-demo-2jmpohtxd-resend.vercel.app/static/vercel-logo.png"
|
||||
style="
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
"
|
||||
width="40"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h1
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
"
|
||||
>
|
||||
<strong>Turbo NPN</strong>
|
||||
</h1>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Hello, ${name}
|
||||
</p>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Turbo NPN send your email verification success message
|
||||
</p>
|
||||
<div style="display: flex;justify-content: center; align-items: center;">
|
||||
<p
|
||||
style="
|
||||
background-color: rgb(0, 0, 0);
|
||||
border-radius: 0.25rem;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
"
|
||||
>
|
||||
Success
|
||||
</p>
|
||||
</div>
|
||||
<hr
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
margin-top: 26px;
|
||||
margin-bottom: 26px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
color: rgb(102, 102, 102);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
Turbo NPN is a free and open source prodcut
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
};
|
||||
|
||||
export default SignInMail;
|
||||
183
apps/api/src/features/mail/templates/forgot-password.mail.ts
Normal file
183
apps/api/src/features/mail/templates/forgot-password.mail.ts
Normal file
@@ -0,0 +1,183 @@
|
||||
const ForgotPasswordMail = ({
|
||||
name,
|
||||
code,
|
||||
}: {
|
||||
name: string;
|
||||
code: string | number;
|
||||
}) => {
|
||||
return `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
</head>
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
line-height: 1px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
max-width: 0;
|
||||
"
|
||||
>
|
||||
Join Turbo NPN
|
||||
</div>
|
||||
<body
|
||||
style="
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
"
|
||||
>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
border-radius: 0.25rem;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 40px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 20px;
|
||||
max-width: 465px;
|
||||
"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="margin-top: 32px"
|
||||
>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
alt="Vercel"
|
||||
height="37"
|
||||
src="https://react-email-demo-2jmpohtxd-resend.vercel.app/static/vercel-logo.png"
|
||||
style="
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
"
|
||||
width="40"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h1
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
"
|
||||
>
|
||||
<strong>Turbo NPN</strong>
|
||||
</h1>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Hello, ${name}
|
||||
</p>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Turbo NPN send your password reset code
|
||||
</p>
|
||||
<div style="display: flex;justify-content: center; align-items: center;">
|
||||
<p
|
||||
style="
|
||||
background-color: rgb(0, 0, 0);
|
||||
border-radius: 0.25rem;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
"
|
||||
>
|
||||
${code}
|
||||
</p>
|
||||
</div>
|
||||
<hr
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
margin-top: 26px;
|
||||
margin-bottom: 26px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
color: rgb(102, 102, 102);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
Turbo NPN is a free and open source prodcut
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
};
|
||||
|
||||
export default ForgotPasswordMail;
|
||||
195
apps/api/src/features/mail/templates/index.ts
Normal file
195
apps/api/src/features/mail/templates/index.ts
Normal file
@@ -0,0 +1,195 @@
|
||||
const EmailTemplate = ({
|
||||
name = '',
|
||||
action = 'sign in',
|
||||
timestamp = new Date().toLocaleString(),
|
||||
location = 'Unknown',
|
||||
device = 'Unknown Device',
|
||||
ipAddress = 'Unknown IP',
|
||||
}) => {
|
||||
return `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
</head>
|
||||
<div style="display: none; overflow: hidden; line-height: 1px; opacity: 0; max-height: 0; max-width: 0;">
|
||||
Security Alert - New ${action} detected for your Turbo NPN account
|
||||
</div>
|
||||
<body style="
|
||||
background-color: #f5f5f5;
|
||||
margin: 0 auto;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
||||
padding: 1rem;
|
||||
">
|
||||
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" style="
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #eaeaea;
|
||||
border-radius: 8px;
|
||||
margin: 40px auto;
|
||||
padding: 30px;
|
||||
max-width: 520px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
">
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
alt="Turbo NPN Logo"
|
||||
height="45"
|
||||
src="https://your-logo-url.com/logo.png"
|
||||
style="
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
"
|
||||
width="48"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h1 style="
|
||||
color: #000000;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
margin: 30px 0;
|
||||
">
|
||||
Security Alert
|
||||
</h1>
|
||||
|
||||
<p style="
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
">
|
||||
Hello ${name},
|
||||
</p>
|
||||
|
||||
<p style="
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
">
|
||||
We detected a new ${action} to your Turbo NPN account. Here are the details:
|
||||
</p>
|
||||
|
||||
<div style="
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin: 24px 0;
|
||||
">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="margin: 12px 0;">
|
||||
<tr>
|
||||
<td style="color: #666666; font-size: 14px; padding: 8px 0;">Time:</td>
|
||||
<td style="color: #333333; font-size: 14px; text-align: right;">${timestamp}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #666666; font-size: 14px; padding: 8px 0;">Location:</td>
|
||||
<td style="color: #333333; font-size: 14px; text-align: right;">${location}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #666666; font-size: 14px; padding: 8px 0;">Device:</td>
|
||||
<td style="color: #333333; font-size: 14px; text-align: right;">${device}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #666666; font-size: 14px; padding: 8px 0;">IP Address:</td>
|
||||
<td style="color: #333333; font-size: 14px; text-align: right;">${ipAddress}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin: 32px 0;">
|
||||
<a href="https://turbo-npn.com/security-settings" style="
|
||||
background-color: #000000;
|
||||
border-radius: 6px;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 12px 24px;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
">
|
||||
Review Security Settings
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p style="
|
||||
color: #666666;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 24px 0;
|
||||
">
|
||||
If you don't recognize this activity, please <a href="https://turbo-npn.com/support" style="color: #000000; text-decoration: underline;">contact our support team</a> immediately and change your password.
|
||||
</p>
|
||||
|
||||
<hr style="
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
margin: 26px 0;
|
||||
width: 100%;
|
||||
" />
|
||||
|
||||
<div style="text-align: center;">
|
||||
<p style="
|
||||
color: #666666;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
">
|
||||
Turbo NPN - Secure, Fast, Reliable
|
||||
</p>
|
||||
|
||||
<div style="margin: 20px 0;">
|
||||
<a href="https://twitter.com/turbonpn" style="text-decoration: none; margin: 0 8px;">
|
||||
<img src="https://your-assets.com/twitter.png" alt="Twitter" width="20" height="20" />
|
||||
</a>
|
||||
<a href="https://facebook.com/turbonpn" style="text-decoration: none; margin: 0 8px;">
|
||||
<img src="https://your-assets.com/facebook.png" alt="Facebook" width="20" height="20" />
|
||||
</a>
|
||||
<a href="https://linkedin.com/company/turbonpn" style="text-decoration: none; margin: 0 8px;">
|
||||
<img src="https://your-assets.com/linkedin.png" alt="LinkedIn" width="20" height="20" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p style="
|
||||
color: #666666;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
">
|
||||
© 2025 Turbo NPN. All rights reserved.
|
||||
</p>
|
||||
|
||||
<p style="
|
||||
color: #666666;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
">
|
||||
<a href="https://turbo-npn.com/privacy" style="color: #666666; text-decoration: underline;">Privacy Policy</a> •
|
||||
<a href="https://turbo-npn.com/terms" style="color: #666666; text-decoration: underline;">Terms of Service</a> •
|
||||
<a href="https://turbo-npn.com/unsubscribe" style="color: #666666; text-decoration: underline;">Unsubscribe</a>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
};
|
||||
|
||||
export default EmailTemplate;
|
||||
183
apps/api/src/features/mail/templates/register.mail.ts
Normal file
183
apps/api/src/features/mail/templates/register.mail.ts
Normal file
@@ -0,0 +1,183 @@
|
||||
const RegisterMail = ({
|
||||
name,
|
||||
code,
|
||||
}: {
|
||||
name: string;
|
||||
code: string | number;
|
||||
}) => {
|
||||
return `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
</head>
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
line-height: 1px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
max-width: 0;
|
||||
"
|
||||
>
|
||||
Join Turbo NPN
|
||||
</div>
|
||||
<body
|
||||
style="
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
"
|
||||
>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
border-radius: 0.25rem;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 40px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 20px;
|
||||
max-width: 465px;
|
||||
"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="margin-top: 32px"
|
||||
>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
alt="Vercel"
|
||||
height="37"
|
||||
src="https://react-email-demo-2jmpohtxd-resend.vercel.app/static/vercel-logo.png"
|
||||
style="
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
"
|
||||
width="40"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h1
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
"
|
||||
>
|
||||
Join <strong>Turbo NPN</strong>
|
||||
</h1>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Hello, ${name}
|
||||
</p>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Turbo NPN send your email verification code
|
||||
</p>
|
||||
<div style="display: flex;justify-content: center; align-items: center;">
|
||||
<p
|
||||
style="
|
||||
background-color: rgb(0, 0, 0);
|
||||
border-radius: 0.25rem;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
"
|
||||
>
|
||||
${code}
|
||||
</p>
|
||||
</div>
|
||||
<hr
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
margin-top: 26px;
|
||||
margin-bottom: 26px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
color: rgb(102, 102, 102);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
Turbo NPN is a free and open source prodcut
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
};
|
||||
|
||||
export default RegisterMail;
|
||||
177
apps/api/src/features/mail/templates/sign-in.mail.ts
Normal file
177
apps/api/src/features/mail/templates/sign-in.mail.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
const SignInMail = ({ name }: { name: string }) => {
|
||||
return `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
</head>
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
line-height: 1px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
max-width: 0;
|
||||
"
|
||||
>
|
||||
Join Turbo NPN
|
||||
</div>
|
||||
<body
|
||||
style="
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
"
|
||||
>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
border-radius: 0.25rem;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 40px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 20px;
|
||||
max-width: 465px;
|
||||
"
|
||||
>
|
||||
<tbody>
|
||||
<tr style="width: 100%">
|
||||
<td>
|
||||
<table
|
||||
align="center"
|
||||
width="100%"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
role="presentation"
|
||||
style="margin-top: 32px"
|
||||
>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
alt="Vercel"
|
||||
height="37"
|
||||
src="https://react-email-demo-2jmpohtxd-resend.vercel.app/static/vercel-logo.png"
|
||||
style="
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
outline: none;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
"
|
||||
width="40"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h1
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
"
|
||||
>
|
||||
<strong>Turbo NPN</strong>
|
||||
</h1>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Hello, ${name}
|
||||
</p>
|
||||
<p
|
||||
style="
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
"
|
||||
>
|
||||
Turbo NPN send your sign in notification email
|
||||
</p>
|
||||
<div style="display: flex;justify-content: center; align-items: center;">
|
||||
<p
|
||||
style="
|
||||
background-color: rgb(0, 0, 0);
|
||||
border-radius: 0.25rem;
|
||||
color: rgb(255, 255, 255);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
line-height: 100%;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
"
|
||||
>
|
||||
New Sign In Detected
|
||||
</p>
|
||||
</div>
|
||||
<hr
|
||||
style="
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgb(234, 234, 234);
|
||||
margin-top: 26px;
|
||||
margin-bottom: 26px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-top: 1px solid #eaeaea;
|
||||
"
|
||||
/>
|
||||
<p
|
||||
style="
|
||||
color: rgb(102, 102, 102);
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
margin: 16px 0;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
Turbo NPN is a free and open source prodcut
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
};
|
||||
|
||||
export default SignInMail;
|
||||
Reference in New Issue
Block a user