Skip to content

Commit

Permalink
Fix broken test mail due to missing tpl param.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 10, 2021
1 parent 35ac1cc commit c8c135e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/campaigns.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ func handleTestCampaign(c echo.Context) error {
var (
app = c.Get("app").(*App)
campID, _ = strconv.Atoi(c.Param("id"))
tplID, _ = strconv.Atoi(c.FormValue("template_id"))
req campaignReq
)

Expand Down Expand Up @@ -581,7 +582,7 @@ func handleTestCampaign(c echo.Context) error {

// The campaign.
var camp models.Campaign
if err := app.queries.GetCampaignForPreview.Get(&camp, campID); err != nil {
if err := app.queries.GetCampaignForPreview.Get(&camp, campID, tplID); err != nil {
if err == sql.ErrNoRows {
return echo.NewHTTPError(http.StatusBadRequest,
app.i18n.Ts("globals.messages.notFound",
Expand Down

0 comments on commit c8c135e

Please sign in to comment.