Skip to content

Commit

Permalink
Refactor template previewing with better dummy data
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 2, 2018
1 parent 027bc02 commit c96de8d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ func handlePreviewTemplate(c echo.Context) error {
}

// 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: "[email protected]",
TemplateBody: body,
Body: dummyTpl,
}

if err := camp.CompileTemplate(app.Runner.TemplateFuncs(&camp)); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Error compiling template: %v", err))
}
Expand Down

0 comments on commit c96de8d

Please sign in to comment.