studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
23 lines (18 loc) • 512 B
text/typescript
import { notification, passwordReset, userInvite, verifyEmail } from './templates/index.js';
export const templates = {
verifyEmail,
notification,
passwordReset,
userInvite,
};
type Templates = typeof templates;
type TemplateKeys = keyof Templates;
/**
* Retrieves the specified email template.
*
* @param template - The template to retrieve.
* @returns The specified email template.
*/
export function getTemplate<T extends TemplateKeys>(template: T): Templates[T] {
return templates[template];
}