fix: pass datetime module to test email template

Fixes warning 'datetime is undefined' that appeared when sending test emails.
The test_email.html template was trying to use datetime.utcnow() to display
the timestamp, but the datetime module wasn't included in the template context.

This change ensures the HTML email template renders correctly with the
formatted timestamp.
This commit is contained in:
Dries Peeters
2025-10-31 10:51:33 +01:00
parent 8e85e41f21
commit 04760170c2
+2 -1
View File
@@ -432,7 +432,8 @@ TimeTracker - Time Tracking & Project Management
mail_server=current_app.config.get('MAIL_SERVER'),
mail_port=current_app.config.get('MAIL_PORT'),
use_tls=current_app.config.get('MAIL_USE_TLS'),
use_ssl=current_app.config.get('MAIL_USE_SSL')
use_ssl=current_app.config.get('MAIL_USE_SSL'),
datetime=datetime
)
current_app.logger.info("[EMAIL TEST] HTML template rendered successfully")
except Exception as template_error: