actually start on mailing, fix email regex
Some checks failed
Code quality checks / biome (push) Failing after 22s
Some checks failed
Code quality checks / biome (push) Failing after 22s
This commit is contained in:
parent
00a7417936
commit
86be889ede
17 changed files with 349 additions and 32 deletions
|
@ -1,3 +1,4 @@
|
|||
export * from "./server";
|
||||
export * from "./validation";
|
||||
export * from "./database";
|
||||
export * from "./mailer";
|
||||
|
|
8
src/environment/constants/mailer.ts
Normal file
8
src/environment/constants/mailer.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { resolve } from "node:path";
|
||||
|
||||
export const templatesPath = resolve(
|
||||
"src",
|
||||
"environment",
|
||||
"mailer",
|
||||
"templates",
|
||||
);
|
|
@ -14,7 +14,7 @@ const forbiddenDisplayNamePatterns = [
|
|||
/[\r\n\t]/,
|
||||
/\s{3,}/,
|
||||
/^\s|\s$/,
|
||||
/#everyone|#here/i,
|
||||
/@everyone|@here/i,
|
||||
/\p{Cf}/u,
|
||||
/\p{Cc}/u,
|
||||
];
|
||||
|
@ -25,7 +25,7 @@ const passwordRestrictions: genericValidation = {
|
|||
};
|
||||
|
||||
const emailRestrictions: { regex: RegExp } = {
|
||||
regex: /^[^\s#]+#[^\s#]+\.[^\s#]+$/,
|
||||
regex: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
||||
};
|
||||
|
||||
export {
|
||||
|
|
32
src/environment/mailer/templates/register.html
Normal file
32
src/environment/mailer/templates/register.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{subject}}</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Hi {{displayName}},</p>
|
||||
<p>Thank you for registering with {{companyName}}. Your account has been successfully created.</p>
|
||||
|
||||
<h2>Account Details:</h2>
|
||||
<p>
|
||||
<strong>User ID:</strong> {{id}}<br>
|
||||
<strong>Verification Status:</strong> {{isVerified}}
|
||||
</p>
|
||||
|
||||
<p>To get started, please verify your email address by clicking the link below:</p>
|
||||
<p><a href="{{verificationUrl}}">Verify Email Address</a></p>
|
||||
|
||||
<p>If you didn't create this account, please ignore this email.</p>
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
Best regards,<br>
|
||||
The {{companyName}} team
|
||||
</p>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue