# HG changeset patch
# User Christophe de Vienne <christophe@cdevienne.info>
# Date 1740577820 -3600
#      Wed Feb 26 14:50:20 2025 +0100
# Node ID 99526703f8538635b8862f899ee14656a7760013
# Parent  39d581a5fb244b661d909c3a55e3ad4a2f135fbd
preview can now be html

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
@@ -40,6 +40,12 @@
 		return template_management.NewAccountTemplatePreviewNotModified().WithETag(etag)
 	}
 
+	mimetype := "image/png"
+
+	if params.Format == "html" {
+		mimetype = "text/html"
+	}
+
 	documents, err := h.renderer.Render(
 		ctx,
 		principal.Subject,
@@ -50,7 +56,7 @@
 			BodyFormat: template.BodyFormat,
 		},
 		models.Metadata{},
-		"image/png",
+		mimetype,
 		false,
 	)
 	if err != nil {