This repository has been archived on 2026-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Gishen-Email-Templates/emails/utils/interpolate.ts
Kirubel-Kibru-Yaltopia f9fa3bc83b feat: add Gishen React Email demo with en/am templates
Ship 23 transactional templates, shared brand tokens/logo, preview UI,
render API, CHANGELOG, and docs for Ecom/Admin/B2B consumers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 22:12:21 +03:00

4 lines
175 B
TypeScript

export function interpolate(template: string, vars: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (_, key: string) => String(vars[key] ?? ''));
}