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:
parent
e3ae855a0b
commit
db5d631b0d
6 changed files with 186 additions and 6 deletions
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue