👌 IMPROVE: make RootURL available in email templates (#1812)

Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
This commit is contained in:
Jonas Sulzer 2024-04-04 19:27:52 +02:00 committed by GitHub
parent c48fe973e2
commit 1d32d4c368
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -472,6 +472,7 @@ func initCampaignManager(q *models.Queries, cs *constants, app *App) *manager.Ma
ViewTrackURL: cs.ViewTrackURL,
MessageURL: cs.MessageURL,
ArchiveURL: cs.ArchiveURL,
RootURL: cs.RootURL,
UnsubHeader: ko.Bool("privacy.unsubscribe_header"),
SlidingWindow: ko.Bool("app.message_sliding_window"),
SlidingWindowDuration: ko.Duration("app.message_sliding_window_duration"),

View file

@ -124,6 +124,7 @@ type Config struct {
MessageURL string
ViewTrackURL string
ArchiveURL string
RootURL string
UnsubHeader bool
// Interval to scan the DB for active campaign checkpoints.
@ -353,6 +354,9 @@ func (m *Manager) TemplateFuncs(c *models.Campaign) template.FuncMap {
"ArchiveURL": func() string {
return m.cfg.ArchiveURL
},
"RootURL": func() string {
return m.cfg.RootURL
}
}
for k, v := range m.tplFuncs {