Feat add. variables {{name}} the message sent

This commit is contained in:
Wender Teixeira
2022-01-12 00:31:12 -03:00
parent 783c05d172
commit f4653aaaf4
6 changed files with 66 additions and 18 deletions

View 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);
};