feat: inline unsubscribe button on email rows
- ✉✕ button appears on rows where the email has a List-Unsubscribe header
- One-click POST / HTTP GET executed automatically; shows ✓ on success
- mailto: targets open the user mail client (we never auto-send email)
- POST /email/{id}/unsubscribe: detects sender, then processes — UserId scoped
- EmailSummaryDto gains IsStarred, HasListUnsubscribe, SupportsOneClick fields
- Both SearchService and CleanupService updated to populate new DTO fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,8 @@ public class CleanupService : ICleanupService
|
||||
var emails = await ResolveTargetsAsync(userId, request, ct);
|
||||
var sample = emails.Take(25).Select(e => new EmailSummaryDto(
|
||||
e.Id, e.GmailMessageId, e.Subject, e.Snippet, e.Sender!.Address, e.Sender.DisplayName,
|
||||
e.SentAtUtc, e.IsUnread, e.HasAttachments, e.SizeEstimateBytes, e.Category)).ToList();
|
||||
e.SentAtUtc, e.IsUnread, e.IsStarred, e.HasAttachments, e.SizeEstimateBytes, e.Category,
|
||||
e.HasListUnsubscribe, e.SupportsOneClickUnsubscribe)).ToList();
|
||||
|
||||
return new CleanupPreviewDto(request.Action, emails.Count, emails.Sum(e => e.SizeEstimateBytes), sample);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,8 @@ public class SearchService : ISearchService
|
||||
.Select(e => new EmailSummaryDto(
|
||||
e.Id, e.GmailMessageId, e.Subject, e.Snippet,
|
||||
e.Sender!.Address, e.Sender.DisplayName, e.SentAtUtc,
|
||||
e.IsUnread, e.HasAttachments, e.SizeEstimateBytes, e.Category))
|
||||
e.IsUnread, e.IsStarred, e.HasAttachments, e.SizeEstimateBytes, e.Category,
|
||||
e.HasListUnsubscribe, e.SupportsOneClickUnsubscribe))
|
||||
.ToListAsync(ct);
|
||||
|
||||
return new PagedResult<EmailSummaryDto>
|
||||
|
||||
Reference in New Issue
Block a user