Process completion email should mention erroneous workers
Refs https://redmine.teklia.com/issues/5036
When a process completes, the creator needs to know from the email the completion rate (as it's really different if a process has 0.1% elements failed vs 90% failed).
So the template should list all workers with some erroneous worker activities:
Your process has 2 workers with erroneous elements:
- DAN worker with 90% failures (180/200)
- publication worker with 1% failures (1/200)
You can probably reuse parts of the code from worker actvity stats endpoint, as this is the same information, but displayed in another fashion.
It would also be benefitial to move all the code from TaskSerializer.update
that builds the email into a dedicated async task.