refactor: abstract site URL across email templates
- Add NEXT_PUBLIC_SITE_URL to .env.local - Update email templates to accept siteUrl prop - Update webhook handler to pass siteUrl from env var - Update create-webhooks.graphql with placeholder URL
This commit is contained in:
@@ -16,6 +16,7 @@ interface BaseLayoutProps {
|
||||
children: React.ReactNode;
|
||||
previewText: string;
|
||||
language: string;
|
||||
siteUrl: string;
|
||||
}
|
||||
|
||||
const translations: Record<string, { footer: string; company: string }> = {
|
||||
@@ -37,7 +38,7 @@ const translations: Record<string, { footer: string; company: string }> = {
|
||||
},
|
||||
};
|
||||
|
||||
export function BaseLayout({ children, previewText, language }: BaseLayoutProps) {
|
||||
export function BaseLayout({ children, previewText, language, siteUrl }: BaseLayoutProps) {
|
||||
const t = translations[language] || translations.en;
|
||||
|
||||
return (
|
||||
@@ -48,7 +49,7 @@ export function BaseLayout({ children, previewText, language }: BaseLayoutProps)
|
||||
<Container style={styles.container}>
|
||||
<Section style={styles.logoSection}>
|
||||
<Img
|
||||
src="https://manoonoils.com/logo.png"
|
||||
src={`${siteUrl}/logo.png`}
|
||||
width="150"
|
||||
height="auto"
|
||||
alt="ManoonOils"
|
||||
|
||||
Reference in New Issue
Block a user