mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
13 lines
271 B
TypeScript
13 lines
271 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;
|
|
});
|
|
};
|