kenso war das

This commit is contained in:
2026-02-03 23:27:25 +01:00
parent 6bf3c603d8
commit ef2faa21fd
73 changed files with 8416 additions and 257 deletions

View File

@@ -164,7 +164,7 @@ router.post('/connect-demo',
}),
asyncHandler(async (req, res) => {
const { userId } = req.body
const demoEmail = `demo-${userId.slice(0, 8)}@emailsorter.demo`
const demoEmail = `demo-${userId.slice(0, 8)}@mailflow.demo`
// Check if demo account already exists
const existingAccounts = await emailAccounts.getByUser(userId)
@@ -456,7 +456,7 @@ router.post('/sort',
try {
const gmail = await getGmailService(account.accessToken, account.refreshToken)
// FIRST: Clean up old "EmailSorter/..." labels
// FIRST: Clean up old "MailFlow/..." labels
const deletedLabels = await gmail.cleanupOldLabels()
if (deletedLabels > 0) {
log.success(`${deletedLabels} old labels cleaned up`)
@@ -528,7 +528,7 @@ router.post('/sort',
for (const nl of preferences.nameLabels) {
if (!nl.enabled) continue
try {
const labelName = `EmailSorter/Team/${nl.name}`
const labelName = `MailFlow/Team/${nl.name}`
const label = await gmail.createLabel(labelName, '#4a86e8')
if (label) {
nameLabelMap[nl.id || nl.name] = label.id
@@ -1203,7 +1203,7 @@ router.post('/sort-demo', asyncHandler(async (req, res) => {
/**
* POST /api/email/cleanup
* Cleanup old EmailSorter labels from Gmail
* Cleanup old MailFlow labels from Gmail
*/
router.post('/cleanup',
validate({
@@ -1235,7 +1235,7 @@ router.post('/cleanup',
respond.success(res, {
deleted,
message: deleted > 0
? `${deleted} old "EmailSorter/..." labels were deleted`
? `${deleted} old "MailFlow/..." labels were deleted`
: 'No old labels found'
})
})
@@ -1549,8 +1549,8 @@ async function processPromotionsCleanup(account, action, deleteAfterDays, matchC
const gmail = await getGmailService(account.accessToken, account.refreshToken)
// Find emails with matching categories/labels older than deleteAfterDays
// Look for emails with EmailSorter labels matching the categories
const labelQueries = matchCategories.map(cat => `label:EmailSorter/${cat}`).join(' OR ')
// Look for emails with MailFlow labels matching the categories
const labelQueries = matchCategories.map(cat => `label:MailFlow/${cat}`).join(' OR ')
const query = `(${labelQueries}) before:${cutoffDate.getFullYear()}/${String(cutoffDate.getMonth() + 1).padStart(2, '0')}/${String(cutoffDate.getDate()).padStart(2, '0')}`
const response = await gmail.gmail.users.messages.list({