[PR #451] [MERGED] feat: send email to user when api key expires within 7 days #788

Closed
opened 2025-10-07 00:22:22 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/451
Author: @kmendell
Created: 4/17/2025
Status: Merged
Merged: 4/20/2025
Merged by: @kmendell

Base: mainHead: feat/api-key-email


📝 Commits (10+)

  • 6131e18 feat: add api key expiration email
  • 0a119dc remove un-needed logging
  • f885804 make sure name is included in email
  • 42c6fcc run first api key job async
  • 3ea21bf add expiration_email_sent database column to eliminate duplicate emails
  • c9622a2 Merge branch 'main' into feat/api-key-email
  • 77cd16d Update backend/resources/email-templates/api-key-expiring-soon_text.tmpl
  • 9b4eeb6 Update backend/resources/email-templates/api-key-expiring-soon_html.tmpl
  • cb6f1d0 remove run on start
  • 74b1d5c use datatype.DateTime instead of unix timestamps

📊 Changes

14 files changed (+164 additions, -18 deletions)

View changed files

📝 backend/internal/bootstrap/router_bootstrap.go (+2 -1)
📝 backend/internal/dto/api_key_dto.go (+7 -6)
backend/internal/job/api_key_expiry_job.go (+49 -0)
📝 backend/internal/model/api_key.go (+6 -5)
📝 backend/internal/service/api_key_service.go (+49 -3)
📝 backend/internal/service/audit_log_service.go (+1 -1)
📝 backend/internal/service/email_service_templates.go (+14 -1)
📝 backend/internal/service/user_service.go (+1 -1)
backend/resources/email-templates/api-key-expiring-soon_html.tmpl (+17 -0)
backend/resources/email-templates/api-key-expiring-soon_text.tmpl (+10 -0)
backend/resources/migrations/postgres/20250417120000_add_expiration_email_sent_to_api_keys.down.sql (+2 -0)
backend/resources/migrations/postgres/20250417120000_add_expiration_email_sent_to_api_keys.up.sql (+2 -0)
backend/resources/migrations/sqlite/20250417120000_add_expiration_email_sent_to_api_keys.down.sql (+2 -0)
backend/resources/migrations/sqlite/20250417120000_add_expiration_email_sent_to_api_keys.up.sql (+2 -0)

📄 Description

image

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/451 **Author:** [@kmendell](https://github.com/kmendell) **Created:** 4/17/2025 **Status:** ✅ Merged **Merged:** 4/20/2025 **Merged by:** [@kmendell](https://github.com/kmendell) **Base:** `main` ← **Head:** `feat/api-key-email` --- ### 📝 Commits (10+) - [`6131e18`](https://github.com/pocket-id/pocket-id/commit/6131e1885c7ea3f468d418fa8a46c25ed95cb1c8) feat: add api key expiration email - [`0a119dc`](https://github.com/pocket-id/pocket-id/commit/0a119dc33ec8411aa66760a8736ab860d75e713f) remove un-needed logging - [`f885804`](https://github.com/pocket-id/pocket-id/commit/f885804efdeb88478dd840a139c7b385b9e2e473) make sure name is included in email - [`42c6fcc`](https://github.com/pocket-id/pocket-id/commit/42c6fcce57da618e974a5abda3642b8d554fe981) run first api key job async - [`3ea21bf`](https://github.com/pocket-id/pocket-id/commit/3ea21bf73831db8e77a06f4d6affbde67814b8c8) add expiration_email_sent database column to eliminate duplicate emails - [`c9622a2`](https://github.com/pocket-id/pocket-id/commit/c9622a286035b226a62f96cd418ccede38a72308) Merge branch 'main' into feat/api-key-email - [`77cd16d`](https://github.com/pocket-id/pocket-id/commit/77cd16d62d720898f4543d39073e43708207ebdf) Update backend/resources/email-templates/api-key-expiring-soon_text.tmpl - [`9b4eeb6`](https://github.com/pocket-id/pocket-id/commit/9b4eeb65f86ad85f6c11fd4074d896b2444d942e) Update backend/resources/email-templates/api-key-expiring-soon_html.tmpl - [`cb6f1d0`](https://github.com/pocket-id/pocket-id/commit/cb6f1d0fee4e694ff504c0ce9aa20e0cf3e24a57) remove run on start - [`74b1d5c`](https://github.com/pocket-id/pocket-id/commit/74b1d5c5e1225643def12d395c86001b906fab23) use datatype.DateTime instead of unix timestamps ### 📊 Changes **14 files changed** (+164 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/bootstrap/router_bootstrap.go` (+2 -1) 📝 `backend/internal/dto/api_key_dto.go` (+7 -6) ➕ `backend/internal/job/api_key_expiry_job.go` (+49 -0) 📝 `backend/internal/model/api_key.go` (+6 -5) 📝 `backend/internal/service/api_key_service.go` (+49 -3) 📝 `backend/internal/service/audit_log_service.go` (+1 -1) 📝 `backend/internal/service/email_service_templates.go` (+14 -1) 📝 `backend/internal/service/user_service.go` (+1 -1) ➕ `backend/resources/email-templates/api-key-expiring-soon_html.tmpl` (+17 -0) ➕ `backend/resources/email-templates/api-key-expiring-soon_text.tmpl` (+10 -0) ➕ `backend/resources/migrations/postgres/20250417120000_add_expiration_email_sent_to_api_keys.down.sql` (+2 -0) ➕ `backend/resources/migrations/postgres/20250417120000_add_expiration_email_sent_to_api_keys.up.sql` (+2 -0) ➕ `backend/resources/migrations/sqlite/20250417120000_add_expiration_email_sent_to_api_keys.down.sql` (+2 -0) ➕ `backend/resources/migrations/sqlite/20250417120000_add_expiration_email_sent_to_api_keys.up.sql` (+2 -0) </details> ### 📄 Description <img width="681" alt="image" src="https://github.com/user-attachments/assets/804d90bf-fe46-46f8-aeb9-cedd23e3c2d5" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-07 00:22:22 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#788