feat(postcard): database overrides for mail templates with file fallback
- postcard owns the system_mail_* tables (postcard.Migrations), run by lagoon as the framework set summercms.postcard after system_files - Send asks an OverrideSource once per message; NewDBSource reads the customized template row through the *gorm.DB published on the app - a failed lookup, missing tables or an override that does not render or fails the safety checks sends the file version and is logged - the caller's Message.Subject still wins; Mailer, Message, NewMailer, Catalog.Register and BootPlugin keep their signatures Plan 35-01, task 2 (tracer).
This commit is contained in:
@@ -346,7 +346,7 @@ func TestMigrateStatusJSON(t *testing.T) {
|
||||
for _, line := range strings.Split(strings.TrimSpace(out), "\n")[1:] {
|
||||
sets = append(sets, strings.Fields(line)[0])
|
||||
}
|
||||
wantSets := []string{"summercms.attach", "summercms.cabana", DeferredHistoryID, QueueHistoryID, "demo.alpha", "demo.beta"}
|
||||
wantSets := []string{"summercms.attach", "summercms.postcard", "summercms.cabana", DeferredHistoryID, QueueHistoryID, "demo.alpha", "demo.beta"}
|
||||
if !slices.Equal(sets, wantSets) {
|
||||
t.Errorf("migrate:status sets = %q, want %q:\n%s", sets, wantSets, out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user