mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
Feat add. variables {{name}} the message sent
This commit is contained in:
9
backend/src/helpers/Mustache.ts
Normal file
9
backend/src/helpers/Mustache.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import Mustache from "mustache";
|
||||
import Contact from "../models/Contact";
|
||||
|
||||
export default (body: string, contact: Contact): string => {
|
||||
const view = {
|
||||
name: contact ? contact.name : ""
|
||||
};
|
||||
return Mustache.render(body, view);
|
||||
};
|
||||
Reference in New Issue
Block a user