Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

feat(database): add email notifications for backups/imports & backup verification

Open Ludy87 opened this issue 4 months ago • 1 comments

Description of Changes

What was changed

  • Added enterprise configuration for database-related email notifications:
    • premium.enterpriseFeatures.databaseNotifications.backups.successful|failed
    • premium.enterpriseFeatures.databaseNotifications.imports.successful|failed
    • Extended ApplicationProperties and settings.yml.template accordingly.
  • Introduced DatabaseNotificationServiceInterface and DatabaseNotificationService to centralize and gate notification sending (EE-only, respects mail.enabled).
  • Wired notifications into DatabaseService:
    • Sends emails on successful/failed backups and imports.
    • Added backup verification step:
      • Compute SHA‑256 checksum for backup files.
      • Validate backup by loading it into an in‑memory H2 instance (RUNSCRIPT) before using it.
      • Abort import if verification fails.
  • Enhanced EmailService:
    • Added sendSimpleMail(String to, String subject, String body) (async) for lightweight notifications.
    • Added debug logging for successful sends.
  • Minor refactors and improved logging around backup/export/import flows.

Why the change was made

  • Provide admins with timely, configurable notifications about critical database operations (backups/imports).
  • Increase reliability by verifying backup integrity before execution, reducing risk from corrupted or incomplete scripts.
  • Keep configuration explicit and self-documenting via new keys in settings.yml.template.

Checklist

General

Documentation

UI Changes (if applicable)

  • [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • [ ] I have tested my changes locally. Refer to the Testing Guide for more details.

Ludy87 avatar Aug 21 '25 14:08 Ludy87

Interesting idea.. hmmm

Frooodle avatar Aug 24 '25 20:08 Frooodle