1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-24 17:00:06 +00:00

Fixed: API key expiring emails not working

This commit is contained in:
ItalyPaleAle
2026-03-04 19:37:33 -08:00
parent 27ca713cd4
commit 33263de1a8
6 changed files with 23 additions and 20 deletions

View File

@@ -37,12 +37,16 @@ func (j *ApiKeyEmailJobs) checkAndNotifyExpiringApiKeys(ctx context.Context) err
}
for _, key := range apiKeys {
if key.User.Email == nil {
if key.User.Email == nil || key.User.ID == "" {
continue
}
err = j.apiKeyService.SendApiKeyExpiringSoonEmail(ctx, key)
if err != nil {
slog.ErrorContext(ctx, "Failed to send expiring API key notification email", slog.String("key", key.ID), slog.Any("error", err))
slog.ErrorContext(ctx, "Failed to send expiring API key notification email",
slog.String("key", key.ID),
slog.String("user", key.User.ID),
slog.Any("error", err),
)
}
}
return nil