♻️ Refactor email templating code (#533)

This commit is contained in:
Luke Vella 2023-03-03 11:46:30 +00:00 committed by GitHub
parent 0a836aeec7
commit 309cb109aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 3926 additions and 1455 deletions

View file

@ -0,0 +1,15 @@
const port = process.env.PORT || 3000;
const getVercelUrl = () => {
return process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: null;
};
export function absoluteUrl(path = "") {
const baseUrl =
process.env.NEXT_PUBLIC_BASE_URL ??
getVercelUrl() ??
`http://localhost:${port}`;
return `${baseUrl}${path}`;
}