yo-next-auth/templates/email/send-verification-email.ts

28 lines
733 B
TypeScript

import { _ctBatch } from '@/lib/translate'
import { env } from '@/lib/utils'
type Props = {
confirmLink: string
}
const keys: any = {
follow: 'follow',
click: 'click',
here: 'here',
confirm: 'confirmed_email',
p1: ['body.send_verification_email.p1', { site_name: env('SITE_NAME') }],
p2: 'body.send_verification_email.p2',
} as const
export const body = async ({ confirmLink }: Props) => {
const t: any = await _ctBatch(keys, 'mailer')
return {
text: `${t?.p1}\n
${t?.follow}: ${confirmLink} ${t?.confirm}
${t?.p2}` as const,
html: `<p>${t?.p1}</p>
<p>${t?.click} <a href="${confirmLink}">${t?.here}</a> ${t?.confirm}</p>
<p>${t?.p2}</p>` as const,
} as const
}