mirror of
https://github.com/documenso/documenso.git
synced 2026-07-03 09:40:43 +10:00
10 lines
264 B
TypeScript
10 lines
264 B
TypeScript
export const renderCustomEmailTemplate = <T extends Record<string, string>>(template: string, variables: T): string => {
|
|
return template.replace(/\{(\S+)\}/g, (_, key) => {
|
|
if (key in variables) {
|
|
return variables[key];
|
|
}
|
|
|
|
return key;
|
|
});
|
|
};
|