4 Commits

Author SHA1 Message Date
Kailash Nadh
583f92a6fc Add bulk deletion (by id or query) to lists and campaigns.
- Like subscribers, select one-or more or 'all' items and delete them
  on the lists and campaigns UIs.
- New `DELETE /api/lists` and `DELETE /api/campaigns` endpoints that
  take one or more `id` params or a single `query` param.
2025-11-28 16:37:20 +05:30
Kailash Nadh
2074604512 Add archival support to lists.
This patch adds a new `status` field (active, archived) to the lists table and
an 'Archived?' toggle on the UI that allows a list to be marked as archived.
This hides the lists from the lists page, campaigns list selection, list roles,
and public forms. A new "View archived lists" link on the lists UI allows
viewing the list of archived lists.

This is useful to hide/declutter lists by archiving historical, temporary lists
etc. This is largely a UX value addition.

Closes #2613.
2025-11-23 15:39:17 +05:30
Kailash Nadh
6417f30d77 Stop recording to send count on campaign creation.
Prior to this patch, when a new campaign was created, the `to send` count of
subscribers was counted from the subscriptions and added to the campaign to be
displayed on the frontend. However, this had several issues:

- On large databases, the count can be extremely slow, slowing down campaign
  creation.
- The count was purely cosmetic. When a campaign starts, it's recounted (for real)
  anyway.
- The count was also inaccurate. Changing the list on a campaign, or changes to
  the subscribers in a list never updated the count on the campaign, rendering
  it wholly incorrect sometimes.

Closes #2431.
2025-11-23 12:13:50 +05:30
Kailash Nadh
3bf8bdb410 Split queries.sql into multiple files for better readability and maintainability. Closes #2738. (#2776)
Co-authored-by: 13unk0wn <n0b0dy0.000729@gmail.com>
2025-11-22 13:23:10 +05:30