politics-rewired / Spoke

Politics Rewired's fork of Spoke
GNU General Public License v3.0
36 stars 17 forks source link

campaign-exports: send one email per bulk export operation #1660

Open henryk1229 opened 1 year ago

henryk1229 commented 1 year ago

Is your feature request related to a problem? Please describe. Support for exporting multiple campaigns at once was introduced by #1641 - but part of the desired behavior was punted in order to unblock merge. Currently, when admins export multiple campaigns they receive one email per campaign exported with links to the relevant urls. Instead, admins should receive one email per bulk operation, with links to each exported campaign's data.

Describe the solution you'd like Currently, the export-multiple-campaigns wraps the export-campaign task, dispatching one task per campaignId included in the payload. The export-multiple-campaigns task should be refactored to:

Describe alternatives you've considered graphile-worker has built-in support for batch jobs, but it's unclear if the use-case fits our needs. It would also likely mean that the multiple vs. single campaign export workflows would deviate significantly, which might lead to confusion or trouble down the line.