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:
10
database.py
10
database.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user