Skip to content

Commit

Permalink
Merge pull request #33 from beabee-communityrm/fix/remove-mc-user-arc…
Browse files Browse the repository at this point in the history
…hive

chore: remove legacy auto-archive feature
  • Loading branch information
wpf500 authored Jul 30, 2024
2 parents 42cb78c + 9161952 commit 20798f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
19 changes: 0 additions & 19 deletions apps/backend/src/tools/mailchimp/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getRepository } from "@beabee/core/database";
import { log as mainLogger } from "@beabee/core/logging";
import { runApp } from "@core/server";

import ContactsService from "@beabee/core/services/ContactsService";
import NewsletterService from "@beabee/core/services/NewsletterService";
import OptionsService from "@beabee/core/services/OptionsService";

Expand Down Expand Up @@ -58,24 +57,6 @@ async function processContacts(contacts: Contact[]) {
contactsToArchive,
OptionsService.getText("newsletter-active-member-tag")
);

if (OptionsService.getBool("newsletter-archive-on-expired")) {
log.info(`Archiving ${contactsToArchive.length} contacts`);
for (const contact of contactsToArchive) {
await ContactsService.updateContactProfile(
contact,
{
newsletterStatus: NewsletterStatus.Unsubscribed
},
{
// Sync in one go below with upsertContacts
sync: false
}
);
}
await NewsletterService.upsertContacts(contactsToArchive);
await NewsletterService.archiveContacts(contactsToArchive);
}
}

runApp(async () => {
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/data/options/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default {
"email-templates": "{}",
"newsletter-active-member-tag": "Active member",
"newsletter-default-groups": "",
"newsletter-archive-on-expired": "true",
"newsletter-resync-status": "",
"newsletter-resync-data": "",
"tracking-code": "",
Expand Down

0 comments on commit 20798f9

Please sign in to comment.