# HG changeset patch
# User Christophe de Vienne <christophe@cdevienne.info>
# Date 1743065715 -3600
#      Thu Mar 27 09:55:15 2025 +0100
# Node ID bc18303669651e95dfa5acf1fb49f4a690f433e1
# Parent  511d9ef3d029493fce02cfe8139e1c2c042e6b56
preview: pass template metadata

diff --git a/HISTORY.rst b/HISTORY.rst
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -45,6 +45,8 @@
 
 - renderer: add 'OnDocRender' hooks
 
+- preview: fix metadata not being passed to rendering engine
+
 0.8.0 (2024-12-09)
 ==================
 
diff --git a/restapi/handlers/account-template-preview.go b/restapi/handlers/account-template-preview.go
--- a/restapi/handlers/account-template-preview.go
+++ b/restapi/handlers/account-template-preview.go
@@ -54,6 +54,7 @@
 			Type:       template.Produces,
 			Body:       template.Body,
 			BodyFormat: template.BodyFormat,
+			Metadata:   template.StaticMetadata.Clone().Update(template.Metadata),
 		},
 		models.Metadata{},
 		mimetype,