fix empty emails

This commit is contained in:
Hugh Rundle 2024-01-07 17:03:49 +11:00
parent d28dcdb069
commit 464f95ee40
Signed by: hugh
GPG key ID: A7E35779918253F9

View file

@ -200,6 +200,8 @@ class Command(BaseCommand):
coming_events,
]
body = "".join(sections)
if body == "":
body = "<p>No new updates this week.</p><p>Why not spend the time you would have been reading, publishing your own blog post instead?</p>"
for subscriber in subscribers:
opt_out = f"https://{settings.DOMAIN}/unsubscribe-email/{subscriber.token}/{subscriber.id}"