mirror of
https://github.com/documenso/documenso.git
synced 2026-06-22 04:12:06 +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;
|
|
});
|
|
};
|