Refactor template previewing with better dummy data
This commit is contained in:
parent
027bc02a83
commit
c96de8d11f
10
templates.go
10
templates.go
|
@ -98,7 +98,15 @@ func handlePreviewTemplate(c echo.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile the template.
|
// Compile the template.
|
||||||
camp := models.Campaign{TemplateBody: body, Body: dummyTpl}
|
camp := models.Campaign{
|
||||||
|
UUID: "00000000-0000-0000-0000-000000000000",
|
||||||
|
Name: "Dummy Campaign",
|
||||||
|
Subject: "Dummy Campaign Subject",
|
||||||
|
FromEmail: "dummy-campaign@listmonk.app",
|
||||||
|
TemplateBody: body,
|
||||||
|
Body: dummyTpl,
|
||||||
|
}
|
||||||
|
|
||||||
if err := camp.CompileTemplate(app.Runner.TemplateFuncs(&camp)); err != nil {
|
if err := camp.CompileTemplate(app.Runner.TemplateFuncs(&camp)); err != nil {
|
||||||
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Error compiling template: %v", err))
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Error compiling template: %v", err))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue