Add email notification preference for task completion
- Add EmailTaskCompleted field to NotificationPreference model - Update notification repository to include email preference in queries - Check email preference before sending task completion emails - Add email preference toggle to admin panel notification-prefs page - Update API types for email preference support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -156,6 +156,16 @@ export default function NotificationPrefsPage() {
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: 'email_task_completed',
|
||||
header: 'Email: Completed',
|
||||
cell: ({ row }) => (
|
||||
<Switch
|
||||
checked={row.original.email_task_completed}
|
||||
onCheckedChange={() => handleToggle(row.original.id, 'email_task_completed', row.original.email_task_completed)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
cell: ({ row }) => {
|
||||
@@ -194,7 +204,7 @@ export default function NotificationPrefsPage() {
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold">Notification Preferences</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Manage user notification preferences for push notifications
|
||||
Manage user notification preferences for push notifications and emails
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -597,6 +597,8 @@ export interface NotificationPreference {
|
||||
task_assigned: boolean;
|
||||
residence_shared: boolean;
|
||||
warranty_expiring: boolean;
|
||||
// Email preferences
|
||||
email_task_completed: boolean;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
@@ -616,6 +618,8 @@ export interface UpdateNotificationPrefRequest {
|
||||
task_assigned?: boolean;
|
||||
residence_shared?: boolean;
|
||||
warranty_expiring?: boolean;
|
||||
// Email preferences
|
||||
email_task_completed?: boolean;
|
||||
}
|
||||
|
||||
// Notification Preferences API
|
||||
|
||||
Reference in New Issue
Block a user