Add sent emails log to /emails page with full body preview modal
This commit is contained in:
parent
639f093175
commit
d31af062ed
2 changed files with 100 additions and 11 deletions
16
app.py
16
app.py
|
|
@ -3509,11 +3509,21 @@ def emails():
|
|||
|
||||
email_config_valid = bool(EMAIL_CONFIG['email_address'] and EMAIL_CONFIG['email_password'])
|
||||
emails_list = get_emails() if email_config_valid else []
|
||||
|
||||
return render_template('emails.html',
|
||||
|
||||
# Gesendete Emails aus DB laden
|
||||
con = sqlite3.connect(EMAIL_JOURNAL_DB)
|
||||
con.row_factory = sqlite3.Row
|
||||
sent_emails_list = con.execute(
|
||||
"SELECT * FROM sent_emails ORDER BY sent_at DESC LIMIT 200"
|
||||
).fetchall()
|
||||
sent_emails_list = [dict(r) for r in sent_emails_list]
|
||||
con.close()
|
||||
|
||||
return render_template('emails.html',
|
||||
emails=emails_list,
|
||||
email_config_valid=email_config_valid,
|
||||
current_email=EMAIL_CONFIG['email_address'])
|
||||
current_email=EMAIL_CONFIG['email_address'],
|
||||
sent_emails=sent_emails_list)
|
||||
|
||||
|
||||
@app.route('/emails/<email_id>')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue