@nextsparkjs/theme-default 0.1.0-beta.149 → 0.1.0-beta.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/emails/verify-email.ts +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default theme override: Verify Email.
|
|
3
|
+
*
|
|
4
|
+
* This file overrides core's default `verify-email` template when the active
|
|
5
|
+
* theme is `default`. It exists primarily as a working demo of the override
|
|
6
|
+
* convention — drop a sibling file (e.g. `reset-password.ts`,
|
|
7
|
+
* `otp-verification.ts`, `team-invitation.ts`, or any new slug like
|
|
8
|
+
* `welcome.ts`) and rebuild the registry to override or add templates.
|
|
9
|
+
*
|
|
10
|
+
* The visible-but-small customization here is the subject prefix
|
|
11
|
+
* "[default theme] " — enough to distinguish this output from core's default
|
|
12
|
+
* during end-to-end verification, while keeping the body identical.
|
|
13
|
+
*
|
|
14
|
+
* To remove the override and fall back to core's default: delete this file
|
|
15
|
+
* and rebuild the registry.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import coreVerifyEmail from '@nextsparkjs/core/emails/verify-email'
|
|
19
|
+
import type {
|
|
20
|
+
EmailContent,
|
|
21
|
+
VerificationEmailData,
|
|
22
|
+
} from '@nextsparkjs/core/lib/email/types'
|
|
23
|
+
|
|
24
|
+
export default async function verifyEmail(
|
|
25
|
+
data: VerificationEmailData,
|
|
26
|
+
locale?: string,
|
|
27
|
+
): Promise<EmailContent> {
|
|
28
|
+
const result = await coreVerifyEmail(data, locale)
|
|
29
|
+
return {
|
|
30
|
+
...result,
|
|
31
|
+
subject: `[default theme] ${result.subject}`,
|
|
32
|
+
}
|
|
33
|
+
}
|