diff --git a/cmd/install.go b/cmd/install.go index 20c3cdb..5c70d94 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -125,6 +125,17 @@ func install(lastVer string, db *sqlx.DB, fs stuffbin.FileSystem, prompt, idempo lo.Fatalf("error setting default template: %v", err) } + // Default campaign archive template. + archiveTpl, err := fs.Get("/static/email-templates/default-archive.tpl") + if err != nil { + lo.Fatalf("error reading default archive template: %v", err) + } + + var archiveTplID int + if err := q.CreateTemplate.Get(&archiveTplID, "Default archive template", models.TemplateTypeCampaign, "", archiveTpl.ReadBytes()); err != nil { + lo.Fatalf("error creating default campaign template: %v", err) + } + // Sample campaign. if _, err := q.CreateCampaign.Exec(uuid.Must(uuid.NewV4()), models.CampaignTypeRegular, @@ -148,8 +159,8 @@ func install(lastVer string, db *sqlx.DB, fs stuffbin.FileSystem, prompt, idempo campTplID, pq.Int64Array{1}, false, - campTplID, - "{}", + archiveTplID, + `{"name": "Subscriber"}`, ); err != nil { lo.Fatalf("error creating sample campaign: %v", err) } diff --git a/static/email-templates/default-archive.tpl b/static/email-templates/default-archive.tpl new file mode 100644 index 0000000..2e339f3 --- /dev/null +++ b/static/email-templates/default-archive.tpl @@ -0,0 +1,98 @@ + + +
+