new version email template
This commit is contained in:
@@ -25,6 +25,11 @@
|
|||||||
Pi.Alert Report
|
Pi.Alert Report
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td bgcolor=#2656f1 width=100% align=center style="padding: 20px 10px 10px 10px; font-size: 20px; font-weight: bold; color:#ffffff; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2)">
|
||||||
|
<a style="color:#ffffff;cursor:pointer;" href="https://github.com/jokob-sk/Pi.Alert/releases">🆕 New version available 🆕</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ def isNewVersion(newVersion: bool):
|
|||||||
if realeaseTimestamp > buildTimestamp + 600:
|
if realeaseTimestamp > buildTimestamp + 600:
|
||||||
mylog('none', ["[Version check] New version of the container available!"])
|
mylog('none', ["[Version check] New version of the container available!"])
|
||||||
newVersion = True
|
newVersion = True
|
||||||
# updateState(db, 'Back_New_Version_Available', str(newVersionAvailable)) ## TO DO add this back in but avoid circular ref with database
|
|
||||||
|
|
||||||
return newVersion
|
return newVersion
|
||||||
|
|
||||||
|
|||||||
@@ -148,9 +148,16 @@ def send_notifications (db):
|
|||||||
|
|
||||||
# Open html Template
|
# Open html Template
|
||||||
mylog('verbose', ['[Notification] Open html Template'])
|
mylog('verbose', ['[Notification] Open html Template'])
|
||||||
template_file = open(pialertPath + '/back/report_template.html', 'r')
|
|
||||||
|
|
||||||
if conf.newVersionAvailable :
|
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()
|
mail_html = template_file.read()
|
||||||
template_file.close()
|
template_file.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user