{# Overrides invenio_jobs' template to name the community a run worked on. A run of the Update Archive-It captures job either names one community in its arguments or queues a subtask per community, and the mail invenio_jobs sends said only that "Update Archive-It captures" had failed -- not for whom. The job cannot pass the community in: invenio_jobs builds the mail from the job's title and overwrites the run's message with its own progress line. Both variables below stay empty for jobs whose runs carry no community, so every other job's mail keeps its wording. ext.py says how this file is found ahead of invenio_jobs' own, and an instance can still override both. -#} {%- set run_community = run.args.get("community") if run.args is mapping else None %} {%- set failed_communities = [] %} {%- for subtask in run.subtasks or [] %} {%- if subtask.status and subtask.status.name != "SUCCESS" and subtask.args is mapping and subtask.args.get("community") %} {%- set _ = failed_communities.append(subtask.args.get("community")) %} {%- endif %} {%- endfor %} {%- set failed_communities = failed_communities | unique | sort | list %} {#- SPDX-FileCopyrightText: 2026 CERN. SPDX-License-Identifier: MIT -#} {# Run notification email template Context variables: - job: Job object - run: Run object - status_info: Dict with title, user_message, action, color - run_url: URL to view run details - success_count: (optional) Number of successfully processed items #} {% extends "invenio_jobs/emails/base.html" %} {% block content %}
{{ status_info.user_message }}
{{ status_info.action }}
{% if run_community or failed_communities %}| Community: | {{ run_community }} |
| Communities that did not finish: | {{ failed_communities | join(", ") }} |
| Status: | {{ run.status.name }} |
| Run ID: | {{ run.id }} |
| Job ID: | {{ job.id }} |
| Started at: | {{ run.started_at }} |
| Finished at: | {{ run.finished_at }} |
| Failed subtasks: | {{ run.failed_subtasks }} of {{ run.total_subtasks }} |
Error Details:
{{ run.message }}