diff --git a/back/report_template_new_version.html b/back/report_template_new_version.html
index 06520878..216767cb 100755
--- a/back/report_template_new_version.html
+++ b/back/report_template_new_version.html
@@ -25,6 +25,11 @@
Pi.Alert Report
+
+ |
+ 🆕 New version available 🆕
+ |
+
|
diff --git a/pialert/helper.py b/pialert/helper.py
index e790f3a2..f1a41de5 100755
--- a/pialert/helper.py
+++ b/pialert/helper.py
@@ -230,8 +230,7 @@ def isNewVersion(newVersion: bool):
if realeaseTimestamp > buildTimestamp + 600:
mylog('none', ["[Version check] New version of the container available!"])
- newVersion = True
- # updateState(db, 'Back_New_Version_Available', str(newVersionAvailable)) ## TO DO add this back in but avoid circular ref with database
+ newVersion = True
return newVersion
diff --git a/pialert/reporting.py b/pialert/reporting.py
index 1b259917..bc48605d 100755
--- a/pialert/reporting.py
+++ b/pialert/reporting.py
@@ -148,9 +148,16 @@ def send_notifications (db):
# Open html Template
mylog('verbose', ['[Notification] Open html Template'])
- template_file = open(pialertPath + '/back/report_template.html', 'r')
+
+
if conf.newVersionAvailable :
- template_file = open(pialertPath + '/back/report_template_new_version.html', 'r')
+ template_file_path = '/back/report_template_new_version.html'
+ else:
+ template_file_path = '/back/report_template.html'
+
+ mylog('verbose', ['[Notification] Using template', template_file_path])
+
+ template_file = open(pialertPath + template_file_path, 'r')
mail_html = template_file.read()
template_file.close()
|