feat: add email notification for failed and success backup
This commit is contained in:
17
templates/email-error.template
Normal file
17
templates/email-error.template
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>🔴 Urgent: Database Backup Failure Notification</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Hi,</h2>
|
||||
<p>An error occurred during database backup.</p>
|
||||
<h3>Failure Details:</h3>
|
||||
<ul>
|
||||
<li>Error Message: {{.Error}}</li>
|
||||
<li>Date: {{.EndTime}}</li>
|
||||
</ul>
|
||||
<p>©2024 <a href="github.com/jkaninda/pg-bkup">pg-bkup</a></p>
|
||||
</body>
|
||||
</html>
|
||||
22
templates/email.template
Normal file
22
templates/email.template
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>✅ Database Backup Notification – {{.Database}}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Hi,</h2>
|
||||
<p>Backup of the {{.Database}} database has been successfully completed on {{.EndTime}}.</p>
|
||||
<h3>Backup Details:</h3>
|
||||
<ul>
|
||||
<li>Database Name: {{.Database}}</li>
|
||||
<li>Backup Start Time: {{.StartTime}}</li>
|
||||
<li>Backup End Time: {{.EndTime}}</li>
|
||||
<li>Backup Storage: {{.Storage}}</li>
|
||||
<li>Backup Location: {{.BackupLocation}}</li>
|
||||
<li>Backup Size: {{.BackupSize}} bytes</li>
|
||||
</ul>
|
||||
<p>Best regards,</p>
|
||||
<p>©2024 <a href="github.com/jkaninda/pg-bkup">pg-bkup</a></p>
|
||||
</body>
|
||||
</html>
|
||||
7
templates/telegram-error.template
Normal file
7
templates/telegram-error.template
Normal file
@@ -0,0 +1,7 @@
|
||||
🔴 Urgent: Database Backup Failure Notification
|
||||
Hi,
|
||||
An error occurred during database backup.
|
||||
Failure Details:
|
||||
Date: {{.EndTime}}
|
||||
Error Message: {{.Error}}
|
||||
|
||||
11
templates/telegram.template
Normal file
11
templates/telegram.template
Normal file
@@ -0,0 +1,11 @@
|
||||
[✅ Database Backup Notification – {{.Database}}
|
||||
Hi,
|
||||
Backup of the {{.Database}} database has been successfully completed on {{.EndTime}}.
|
||||
|
||||
Backup Details:
|
||||
- Database Name: {{.Database}}
|
||||
- Backup Start Time: {{.StartTime}}
|
||||
- Backup EndTime: {{.EndTime}}
|
||||
- Backup Storage: {{.Storage}}
|
||||
- Backup Location: {{.BackupLocation}}
|
||||
- Backup Size: {{.BackupSize}} bytes
|
||||
Reference in New Issue
Block a user