feat(newsletter): add newsletters listing and detail pages

* Created a newsletters table and added insertion logic during newsletter send.
* Added a /newsletters route to display a list of sent newsletters.
* Implemented a /newsletter/<int:newsletter_id> route for detailed view.
* Developed new templates with navigation, including unsubscribe links.
* Enhanced front-end styling and layout for newsletter pages.
This commit is contained in:
Blake Ridgway 2025-02-18 20:07:30 -06:00
parent e3ae855a0b
commit db5d631b0d
6 changed files with 186 additions and 6 deletions

View file

@ -25,6 +25,16 @@ def init_db():
email TEXT UNIQUE NOT NULL
)
""")
cursor.execute("""
CREATE TABLE IF NOT EXISTS newsletters(
id SERIAL PRIMARY KEY,
subject TEXT NOT NULL,
body TEXT NOT NULL,
sent_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
""")
conn.commit()
cursor.close()
conn.close()