feat: add daily digest email notification module
Build and Push Multi-Platform Images / build-and-push (push) Successful in 50s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 50s
- New DailyDigestModule with scheduled summary email for open dashboard items - Extract StatsService from StatsController for reuse in digest - Add DailyDigestEnabled, UserEmail, UserPreferredUsername to UserSettings entity - Sync email/username from OIDC token on each get/update call - Add dailyDigestEnabled to UserSettingsDto and update API - Notifications tab in UserSettingsPage with enable toggle and "Jetzt senden" button Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
029d5b351f
commit
52438ee11f
12 files changed
+366
-86
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { Controller, Post, Request, HttpCode } from '@nestjs/common';
|
||||
import { DailyDigestService } from './daily-digest.service';
|
||||
|
||||
@Controller('api/daily-digest')
|
||||
export class DailyDigestController {
|
||||
constructor(private readonly dailyDigestService: DailyDigestService) {}
|
||||
|
||||
@Post('send-now')
|
||||
@HttpCode(200)
|
||||
async sendNow(@Request() req: any) {
|
||||
const { userId, email, preferredUsername } = req.user;
|
||||
if (!email) {
|
||||
return { ok: false, error: 'Keine E-Mail-Adresse im Benutzerprofil gefunden.' };
|
||||
}
|
||||
try {
|
||||
await this.dailyDigestService.sendDigestForUser(userId, email, preferredUsername);
|
||||
return { ok: true };
|
||||
} catch (err: any) {
|
||||
return { ok: false, error: err.message };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user