Email footer rework

This commit is contained in:
PxlLoewe
2025-06-01 10:26:10 -07:00
parent 9c4c51f274
commit 55e44d9cde
6 changed files with 49 additions and 121 deletions

View File

@@ -1,6 +1,7 @@
import * as React from "react";
import { User } from "@repo/db";
import { Html, render } from "@react-email/components";
import { EmailFooter } from "./EmailFooter";
const styles = `
* {
@@ -183,43 +184,7 @@ const Template = ({ user, code }: { user: User; code: string }) => (
</td>
</tr>
<tr>
<td style={{ textAlign: "center", paddingTop: "20px" }}>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Impressum
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Datenschutzerklärung
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Knowledgebase
</a>
</td>
<EmailFooter />
</tr>
</tbody>
</table>

View File

@@ -2,6 +2,7 @@ import * as React from "react";
import { Event, User } from "@repo/db";
import { Html, Button, render } from "@react-email/components";
import { Badge } from "./Badge";
import { EmailFooter } from "./EmailFooter";
const styles = `
* {
@@ -132,43 +133,7 @@ const Template = ({ event, user }: { user: User; event: Event }) => (
</td>
</tr>
<tr>
<td style={{ textAlign: "center", paddingTop: "20px" }}>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Impressum
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Datenschutzerklärung
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Knowledgebase
</a>
</td>
<EmailFooter />
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,41 @@
export const EmailFooter = () => {
return (
<td style={{ textAlign: "center", paddingTop: "20px" }}>
<a
href="https://virtualairrescue.com/impressum"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Impressum
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://virtualairrescue.com/datenschutz"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Datenschutzerklärung
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://docs.virtualairrescue.com/"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Knowledgebase
</a>
</td>
);
};

View File

@@ -1,6 +1,7 @@
import * as React from "react";
import { User } from "@repo/db";
import { Html, render } from "@react-email/components";
import { EmailFooter } from "./EmailFooter";
const styles = `
* {
@@ -138,43 +139,7 @@ const Template = ({ user, password }: { user: User; password: string }) => (
</td>
</tr>
<tr>
<td style={{ textAlign: "center", paddingTop: "20px" }}>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Impressum
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Datenschutzerklärung
</a>
<span style={{ margin: "0 10px" }}>|</span>
<a
href="https://your-platform.com"
style={{
padding: "10px",
textDecoration: "none",
borderRadius: "20px",
color: "#011936",
}}
>
Knowledgebase
</a>
</td>
<EmailFooter />
</tr>
</tbody>
</table>

View File

@@ -4,7 +4,7 @@
"outDir": "dist",
"allowImportingTsExtensions": false,
"baseUrl": ".",
"jsx": "react"
"jsx": "react-jsx"
},
"include": ["**/*.ts", "./index.ts", "modules/mail-templates/VerificationCode.tsx"],
"exclude": ["node_modules", "dist"]

View File

@@ -69,15 +69,7 @@ export const options: AuthOptions = {
},
});
if (!dbUser) {
return {
...session,
user: {
name: null,
email: null,
image: null,
},
expires: new Date().toISOString(),
};
return null as any;
}
return {
...session,