@@ -153,7 +220,7 @@ const EventEmail = ({
/>
-
+
{event.location.onlineLink
? getOnlineLocation(event.location.onlineLink)
: event.location.address}
@@ -163,26 +230,32 @@ const EventEmail = ({
{event.location.address && event.location.placeId && (
- {t('maps')}
+
+ {t('maps', tPayload)}
+
)}
-
+
{t.rich('info', {
+ ...tPayload,
xoxnolink: (children) => (
{children}
),
emaillink: (children) => (
-
+
{children}
),
})}
-
+
{unsubscribeSection}
diff --git a/src/email/invite-email.tsx b/src/email/invite-email.tsx
index c8d5c12..9eb449a 100644
--- a/src/email/invite-email.tsx
+++ b/src/email/invite-email.tsx
@@ -4,17 +4,16 @@ import { Body, Container, Img, Section } from '@react-email/components'
import { createTranslator } from 'use-intl'
import { eventRoles, EventUserRoles } from '../types'
-import type { IHost, Translations, WithUnsubscribeToken } from './utils'
+import { defaultHost, IEmailConfig } from '../utils'
+import type { Translations, WithUnsubscribeToken } from './utils'
import {
Center,
defaultBodyStyle,
- defaultHost,
FixedButton,
FixedHeading,
FixedLink,
FixedText,
GeneralEmail,
- getHost,
MEDIA,
MsFix,
renderGenericEmail,
@@ -33,7 +32,7 @@ const translations = {
"You're invited to join the {eventName} team as {roleName}!",
action: 'CLAIM YOUR TEAM SPOT HERE',
info: 'For more information and updates, visit our website. If you have any questions, feel free to reach out to us via email.',
- footer: 'Thank you for using XOXNO!',
+ footer: 'Thank you for using {appName}!',
types: {
'check-in-manager': {
label: 'Check-in Manager',
@@ -55,7 +54,7 @@ const translations = {
} as const satisfies Translations
type IProps = {
- host?: IHost
+ host?: IEmailConfig
name: string
event: {
name: string
@@ -85,7 +84,9 @@ const InviteEmail = ({
namespace: 'invite',
})
- const HOST = getHost(host)
+ const tPayload = { appName: host.appName }
+
+ const HOST = `https://${host.host}`
const href = `${HOST}/event/${event.eventId}/join?guest=${event.inviteId}`
@@ -95,7 +96,7 @@ const InviteEmail = ({
return (
@@ -129,40 +130,45 @@ const InviteEmail = ({
- {t('title', { eventName: event.name })}
+ {t('title', { eventName: event.name, ...tPayload })}
- {t('greeting', { name })}
+ {t('greeting', { name, ...tPayload })}
{t.rich('description', {
+ ...tPayload,
eventName: event.name,
- roleName: t(`types.${mainRole}.label`),
+ roleName: t(`types.${mainRole}.label`, tPayload),
b: (chunks) => {chunks},
})}{' '}
- {t(`types.${mainRole}.description`)}
+ {t(`types.${mainRole}.description`, tPayload)}
- {t('action')}
+ {t('action', tPayload)}
{t.rich('info', {
+ ...tPayload,
xoxnolink: (children) => (
{children}
),
emaillink: (children) => (
-
+
{children}
),
})}
-
+
{unsubscribeSection}
diff --git a/src/email/utils.tsx b/src/email/utils.tsx
index e9dc457..4a454ef 100644
--- a/src/email/utils.tsx
+++ b/src/email/utils.tsx
@@ -241,26 +241,6 @@ export type Translations = {
} & Partial<{ [key in Exclude]: Partial }>
}
-export const defaultHost = 'https://xoxno.com'
-
-const hosts = [
- defaultHost,
- 'https://next.xoxno.com',
- 'https://devnet.xoxno.com',
-] as const
-
-export function getHost(propHost: IHost) {
- return hosts.includes(propHost) ? propHost : defaultHost
-}
-
-export type IHost = (typeof hosts)[number]
-
-export const apiMappers: Record = {
- 'https://xoxno.com': 'https://api.xoxno.com',
- 'https://next.xoxno.com': 'https://api.xoxno.com',
- 'https://devnet.xoxno.com': 'https://devnet-api.xoxno.com',
-}
-
export async function renderGenericEmail(Email: ReactElement) {
const html = await renderAsync(Email, {
pretty: true,
@@ -399,3 +379,9 @@ export function ThankYou({
return {text}
}
+
+/* export const apiMappers: Record = {
+ 'xoxno.com': 'https://api.xoxno.com',
+ 'devnet.xoxno.com': 'https://devnet-api.xoxno.com',
+ 'zonatix.com': 'https://api.xoxno.com',
+} */
diff --git a/src/utils.ts b/src/utils.ts
index f0e9fcc..b36fdf2 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -15,3 +15,29 @@ export function getOnlineLocation(onlineLink: string) {
export function getMapsLink(location: IEventDoc['location']) {
return `https://www.google.com/maps/search/?api=1&query=${location.address}&query_place_id=${location.placeId}`
}
+
+const hosts = ['xoxno.com', 'devnet.xoxno.com', 'zonatix.com'] as const
+
+export type IHost = (typeof hosts)[number]
+
+export interface IEmailConfig {
+ host: IHost
+ appName: string
+ socials: {
+ discord: string
+ twitter: string
+ telegram: string
+ email: string
+ }
+}
+
+export const defaultHost: IEmailConfig = {
+ host: 'xoxno.com',
+ appName: 'XOXNO',
+ socials: {
+ discord: 'https://discord.com/invite/xoxno',
+ email: 'contact@xoxno.com',
+ twitter: 'https://twitter.com/XoxnoNetwork',
+ telegram: 'https://t.me/xoxno',
+ },
+}
|