diff --git a/src/dashboard.py b/src/dashboard.py index 30c4c7a8..223e9d5f 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1463,7 +1463,6 @@ def API_Email_PreviewBody(): try: template = Template(body) download = p.downloadPeer() - # body = template.render(peer=p.toJson(), configurationFile=download) return ResponseObject(data={ "Body": Template(body).render(peer=p.toJson(), configurationFile=download), "Subject": Template(subject).render(peer=p.toJson(), configurationFile=download) diff --git a/src/modules/Peer.py b/src/modules/Peer.py index eff4fdf5..9201a9f0 100644 --- a/src/modules/Peer.py +++ b/src/modules/Peer.py @@ -192,6 +192,10 @@ class Peer: for (key, val) in combine[s]: if val is not None and ((type(val) is str and len(val) > 0) or (type(val) is int and val > 0)): final["file"] += f"{key} = {val}\n" + + final["file"] = jinja2.Template(final["file"]).render(configuration=self.configuration) + + if self.configuration.Protocol == "awg": final["amneziaVPN"] = json.dumps({ "containers": [{