From 62d3782d0400d3ff469d9402d301ecec30e6f0dd Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sat, 21 Jan 2023 12:43:30 +0530 Subject: [PATCH] Use `send_at` date for scheduled campaigns in RSS feed. Closes #1149. --- cmd/archive.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/archive.go b/cmd/archive.go index 348b4000..46051419 100644 --- a/cmd/archive.go +++ b/cmd/archive.go @@ -62,10 +62,16 @@ func handleGetCampaignArchivesFeed(c echo.Context) error { out := make([]*feeds.Item, 0, len(camps)) for _, c := range camps { + pubDate := c.CreatedAt.Time + + if c.SendAt.Valid { + pubDate = c.SendAt.Time + } + out = append(out, &feeds.Item{ Title: c.Subject, Link: &feeds.Link{Href: c.URL}, - Created: c.CreatedAt.Time, + Created: pubDate, }) }