MCP Server 2.0 (#452)
* MCP Server 2.0 - Updated application version from 2.23.14 to 2.24.0 in package.json. - MCP Server improved with new features - Migrated functionality from Dev Tools to MCP Server - Improved getMonitoringProvider not to crash application when misconfigured
This commit is contained in:
committed by
GitHub
parent
059408a70a
commit
f3ac595d06
22
packages/email-templates/AGENTS.md
Normal file
22
packages/email-templates/AGENTS.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Email Templates Instructions
|
||||
|
||||
This package owns transactional email templates and renderers using React Email.
|
||||
|
||||
## Non-negotiables
|
||||
|
||||
1. New email must be added to `src/registry.ts` (`EMAIL_TEMPLATE_RENDERERS`) or dynamic inclusion/discovery will miss it.
|
||||
2. New email renderer must be exported from `src/index.ts`.
|
||||
3. Renderer contract: async function returning `{ html, subject }`.
|
||||
4. i18n namespace must match locale filename in `src/locales/<lang>/<namespace>.json`.
|
||||
5. Reuse shared primitives in `src/components/*` for layout/style consistency.
|
||||
6. Include one clear CTA and a plain URL fallback in body copy.
|
||||
7. Keep subject/body concise, action-first, non-spammy.
|
||||
|
||||
## When adding a new email
|
||||
|
||||
1. Add template in `src/emails/*.email.tsx`.
|
||||
2. Add locale file in `src/locales/en/*-email.json` if template uses i18n.
|
||||
3. Export template renderer from `src/index.ts`.
|
||||
4. Add renderer to `src/registry.ts` (`EMAIL_TEMPLATE_RENDERERS`).
|
||||
|
||||
`src/registry.ts` is required for dynamic inclusion/discovery. If not added there, dynamic template listing/rendering will miss it.
|
||||
1
packages/email-templates/CLAUDE.md
Normal file
1
packages/email-templates/CLAUDE.md
Normal file
@@ -0,0 +1 @@
|
||||
@AGENTS.md
|
||||
@@ -10,7 +10,8 @@
|
||||
},
|
||||
"prettier": "@kit/prettier-config",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
".": "./src/index.ts",
|
||||
"./registry": "./src/registry.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-email/components": "catalog:"
|
||||
@@ -20,7 +21,10 @@
|
||||
"@kit/i18n": "workspace:*",
|
||||
"@kit/prettier-config": "workspace:*",
|
||||
"@kit/tsconfig": "workspace:*",
|
||||
"@types/node": "catalog:"
|
||||
"@types/node": "catalog:",
|
||||
"@types/react": "catalog:",
|
||||
"react": "catalog:",
|
||||
"react-dom": "catalog:"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
|
||||
39
packages/email-templates/src/registry.ts
Normal file
39
packages/email-templates/src/registry.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { renderAccountDeleteEmail } from './emails/account-delete.email';
|
||||
import { renderInviteEmail } from './emails/invite.email';
|
||||
import { renderOtpEmail } from './emails/otp.email';
|
||||
|
||||
/**
|
||||
* Registry of email template renderers.
|
||||
*
|
||||
* This is used to render email templates dynamically. Ex. list all available email templates in the MCP server.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* const { html, subject } = await renderAccountDeleteEmail({
|
||||
* userDisplayName: 'John Doe',
|
||||
* productName: 'My SaaS App',
|
||||
* });
|
||||
*
|
||||
* await mailer.sendEmail({
|
||||
* to: 'user@example.com',
|
||||
* from: 'noreply@yourdomain.com',
|
||||
* subject,
|
||||
* html,
|
||||
* });
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* const { html, subject } = await renderAccountDeleteEmail({
|
||||
* userDisplayName: 'John Doe',
|
||||
* productName: 'My SaaS App',
|
||||
* });
|
||||
*
|
||||
*/
|
||||
export const EMAIL_TEMPLATE_RENDERERS = {
|
||||
'account-delete-email': renderAccountDeleteEmail,
|
||||
'invite-email': renderInviteEmail,
|
||||
'otp-email': renderOtpEmail,
|
||||
};
|
||||
|
||||
export type EmailTemplateRenderer =
|
||||
(typeof EMAIL_TEMPLATE_RENDERERS)[keyof typeof EMAIL_TEMPLATE_RENDERERS];
|
||||
Reference in New Issue
Block a user