mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-10-01 06:38:00 -05:00
feat: add assets subdomain, add email assets
This commit is contained in:
203
src/assets/emails/emailConfirmationTemplate.html
Normal file
203
src/assets/emails/emailConfirmationTemplate.html
Normal file
@@ -0,0 +1,203 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" lang="en">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
supported-color-schemes:light dark;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
body.email-body,
|
||||
table.centerer,
|
||||
table.wrapper {
|
||||
background-color: #FFFFFF !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
table.card {
|
||||
background-color: #673DB6 !important;
|
||||
}
|
||||
span.shoutout {
|
||||
color: #D9C6FA !important;
|
||||
}
|
||||
td.confirm-link {
|
||||
background-color: #9D6FF3 !important;
|
||||
}
|
||||
td.confirm-code {
|
||||
background-color: #D9C6FA !important;
|
||||
color: #45297A !important;
|
||||
}
|
||||
td.notice {
|
||||
color: #9D6FF3 !important;
|
||||
}
|
||||
td.notice a {
|
||||
color: #673DB6 !important;
|
||||
}
|
||||
img.logo {
|
||||
content: url("https://assets.pretendo.cc/images/pretendo-wordmark-singlecolor-purple.png") !important;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body.email-body,
|
||||
table.centerer,
|
||||
table.wrapper {
|
||||
background-color: #1B1F3B !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
table.card {
|
||||
background-color: #23274A !important;
|
||||
}
|
||||
span.shoutout {
|
||||
color: #CAB1FB !important;
|
||||
}
|
||||
td.confirm-link {
|
||||
background-color: #673DB6 !important;
|
||||
}
|
||||
td.confirm-code {
|
||||
background-color: #373C65 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
td.notice {
|
||||
color: #8990C1 !important;
|
||||
}
|
||||
td.notice a {
|
||||
color: #CAC1F5 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="email-body" bgcolor="#1B1F3B" style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; font-family: Poppins, Arial, Helvetica, sans-serif;">
|
||||
<div style="display:none;">Hello {{username}}! Your Pretendo Network ID activation is almost complete. Please click the link in this email to confirm your e-mail address and complete the activation process.</div>
|
||||
<table class="centerer" bgcolor="#1B1F3B" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<table class="wrapper" bgcolor="#1B1F3B" style="font-family: Poppins, Arial, Helvetica, sans-serif;" border="0" cellpadding="0" cellspacing="0" height="100%" width="420px">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td width="32px"> </td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td height="36px" style="line-height: 36px;" width="100%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://pretendo.network">
|
||||
<img class="logo" width="auto" height="48px" src="https://assets.pretendo.cc/images/pretendo-wordmark-multicolor-purple+white.png" alt="Pretendo">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="36px" style="line-height: 36px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="card" bgcolor="#23274a" style="color: #ffffff; border-radius: 10px;" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td width="24px" height="100%"> </td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr width="100%" height="48px" style="line-height: 48px;">
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 24px; font-weight: 700;">
|
||||
<td>
|
||||
Hello <span class="shoutout" style="color: #cab1fb;">{{username}}</span>!
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="24px" style="line-height: 24px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #ffffff; ">
|
||||
Your Pretendo Network ID activation is almost complete. Please click the link below to confirm your e-mail address and complete the activation process.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="16px" style="line-height: 16px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="confirm-link" bgcolor="#673db6" style="font-size: 14px; font-weight: 700; border-radius: 10px; padding: 12px" align="center">
|
||||
<a href="{{confirmation-url}}" style="text-decoration: none; color: #ffffff; " width="100%">
|
||||
Confirm email address
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="48px" style="line-height: 48px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
You may also enter the following 6-digit code on your console:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="16px" style="line-height: 16px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="confirm-code" bgcolor="#373c65" style="color: #ffffff; font-size: 14px; font-weight: 700; border-radius: 10px; padding: 12px" align="center">
|
||||
{{confirmation-code}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="48px" style="line-height: 48px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
We hope you have fun using our services!
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="36px" style="line-height: 36px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
The Pretendo Network team
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="24px" style="line-height: 24px;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="24px" height="100%"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="18px" style="line-height: 18px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="notice" style="color: #8990c1; font-size: 12px;">
|
||||
Note: this email message was auto-generated, please do not respond. For further assistance, please join our <a href="https://invite.gg/pretendo" style="text-decoration: none; color: #ffffff; ">Discord server</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="48px" style="line-height: 48px;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="32px"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
169
src/assets/emails/genericTemplate.html
Normal file
169
src/assets/emails/genericTemplate.html
Normal file
@@ -0,0 +1,169 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" lang="en">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
supported-color-schemes:light dark;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
body.email-body,
|
||||
table.centerer,
|
||||
table.wrapper {
|
||||
background-color: #FFFFFF !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
table.card {
|
||||
background-color: #673DB6 !important;
|
||||
}
|
||||
span.shoutout {
|
||||
color: #D9C6FA !important;
|
||||
}
|
||||
td.confirm-link {
|
||||
background-color: #9D6FF3 !important;
|
||||
}
|
||||
td.confirm-code {
|
||||
background-color: #D9C6FA !important;
|
||||
color: #45297A !important;
|
||||
}
|
||||
td.notice {
|
||||
color: #9D6FF3 !important;
|
||||
}
|
||||
td.notice a {
|
||||
color: #673DB6 !important;
|
||||
}
|
||||
img.logo {
|
||||
content: url("https://assets.pretendo.cc/images/pretendo-wordmark-singlecolor-purple.png") !important;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body.email-body,
|
||||
table.centerer,
|
||||
table.wrapper {
|
||||
background-color: #1B1F3B !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
table.card {
|
||||
background-color: #23274A !important;
|
||||
}
|
||||
span.shoutout {
|
||||
color: #CAB1FB !important;
|
||||
}
|
||||
td.confirm-link {
|
||||
background-color: #673DB6 !important;
|
||||
}
|
||||
td.confirm-code {
|
||||
background-color: #373C65 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
td.notice {
|
||||
color: #8990C1 !important;
|
||||
}
|
||||
td.notice a {
|
||||
color: #CAC1F5 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="email-body" bgcolor="#1B1F3B" style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; font-family: Poppins, Arial, Helvetica, sans-serif;">
|
||||
<div style="display:none;">{{preview}}</div>
|
||||
<table class="centerer" bgcolor="#1B1F3B" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<table class="wrapper" bgcolor="#1B1F3B" style="font-family: Poppins, Arial, Helvetica, sans-serif;" border="0" cellpadding="0" cellspacing="0" height="100%" width="420px">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td width="32px"> </td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td height="36px" style="line-height: 36px;" width="100%"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://pretendo.network">
|
||||
<img class="logo" width="auto" height="48px" src="https://assets.pretendo.cc/images/pretendo-wordmark-multicolor-purple+white.png" alt="Pretendo">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="36px" style="line-height: 36px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="card" bgcolor="#23274a" style="color: #ffffff; border-radius: 10px;" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr>
|
||||
<td width="24px" height="100%"> </td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
|
||||
<tr width="100%" height="48px" style="line-height: 48px;">
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 24px; font-weight: 700;">
|
||||
<td>
|
||||
Dear <span class="shoutout" style="color: #cab1fb;">{{username}}</span>,
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="24px" style="line-height: 24px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color: #ffffff; ">
|
||||
{{paragraph}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="36px" style="line-height: 36px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
The Pretendo Network team
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="24px" style="line-height: 24px;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="24px" height="100%"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="18px" style="line-height: 18px;"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="notice" style="color: #8990c1; font-size: 12px;">
|
||||
Note: this email message was auto-generated, please do not respond. For further assistance, please join our <a href="https://invite.gg/pretendo" style="text-decoration: none; color: #ffffff; ">Discord server</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" height="48px" style="line-height: 48px;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="32px"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
BIN
src/assets/images/pretendo-wordmark-multicolor-purple+white.png
Normal file
BIN
src/assets/images/pretendo-wordmark-multicolor-purple+white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/assets/images/pretendo-wordmark-singlecolor-purple.png
Normal file
BIN
src/assets/images/pretendo-wordmark-singlecolor-purple.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
@@ -23,6 +23,7 @@ const nasc = require('./services/nasc');
|
||||
const datastore = require('./services/datastore');
|
||||
const api = require('./services/api');
|
||||
const localcdn = require('./services/local-cdn');
|
||||
const assets = require('./services/assets');
|
||||
|
||||
// START APPLICATION
|
||||
|
||||
@@ -42,6 +43,7 @@ app.use(nasc);
|
||||
app.use(datastore);
|
||||
app.use(api);
|
||||
app.use(localcdn);
|
||||
app.use(assets);
|
||||
|
||||
// 404 handler
|
||||
logger.info('Creating 404 status handler');
|
||||
|
||||
22
src/services/assets/index.js
Normal file
22
src/services/assets/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// handles serving assets
|
||||
|
||||
const express = require('express');
|
||||
const subdomain = require('express-subdomain');
|
||||
const logger = require('../../../logger');
|
||||
const path = require('path');
|
||||
|
||||
// Router to handle the subdomain restriction
|
||||
const assets = express.Router();
|
||||
|
||||
// Setup public folder
|
||||
logger.info('[assets] Setting up public folder');
|
||||
assets.use(express.static(path.join(__dirname, '../../assets')));
|
||||
|
||||
// Main router for endpoints
|
||||
const router = express.Router();
|
||||
|
||||
// Create subdomains
|
||||
logger.info('[conntest] Creating \'assets\' subdomain');
|
||||
router.use(subdomain('assets', assets));
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user