actually start on mailing, fix email regex
Some checks failed
Code quality checks / biome (push) Failing after 22s

This commit is contained in:
creations 2025-06-10 16:34:15 -04:00
parent 00a7417936
commit 86be889ede
Signed by: creations
GPG key ID: 8F553AA4320FC711
17 changed files with 349 additions and 32 deletions

View file

@ -1,3 +1,4 @@
export * from "./server";
export * from "./validation";
export * from "./database";
export * from "./mailer";

View file

@ -0,0 +1,8 @@
import { resolve } from "node:path";
export const templatesPath = resolve(
"src",
"environment",
"mailer",
"templates",
);

View file

@ -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 {

View 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>