Skip to content

Document email template and system config variable endpoints - #381

Open
MoamenElbarqy wants to merge 1 commit into
DSpace:mainfrom
MoamenElbarqy:feature/email-templates-docs
Open

Document email template and system config variable endpoints#381
MoamenElbarqy wants to merge 1 commit into
DSpace:mainfrom
MoamenElbarqy:feature/email-templates-docs

Conversation

@MoamenElbarqy

@MoamenElbarqy MoamenElbarqy commented Sep 8, 2026

Copy link
Copy Markdown

References

  • Related to DSpace/dspace-angular#5828
  • Backend implementation: DSpace/DSpace#13091
  • Coordinated 3-Repository Feature (Part 2 of 3):
    • Part 1 (Backend REST API & Services): DSpace/DSpace#13091
    • Part 2 (This PR - REST Contract Documentation): DSpace/RestContract
    • Part 3 (Coming soon - Angular Admin UI & Management): DSpace/dspace-angular (Branch: feature/admin-email-templates)

Description

Documents the two new admin-only endpoints for email template management:

  • /api/system/emailtemplates (list, retrieve with ETag / If-None-Match → 304 supporting multi-value, weak W/, and wildcard *, update with If-Match → 428/412 supporting multi-value, weak W/, and wildcard *, preserving template whitespace, 400 on VTL/XSS/length violations).
  • /api/system/systemconfigvariables (paginated list + retrieve single allowed config variable: key, value, placeholder).

Key contract decision: Configuration variables are not embedded in template payloads — clients fetch them once from the dedicated endpoint instead of receiving the identical list duplicated in every template.


List of Changes in this PR

  • emailtemplates.md: Documents template endpoints, field constraints (name pattern, content 10–50000, subject max 500, variable description max 500, placeholder max 30), ETag concurrency with multi-value/weak validator/wildcard handling, accurate deterministic content hash example, and whitespace preservation behavior on update.
  • systemconfigvariables.md: Paginated list with HAL _links and page metadata + retrieve-single contract with example payloads, field constraints (key pattern, value max 2000, placeholder max 255), clean contract phrasing, and status codes (200, 401, 403, 404).
  • endpoints.md: Linked both pages.

Checklist

  • My PR is created against the main branch of code.
  • My documentation matches the backend implementation (DSpace/DSpace#13091: endpoint paths, systemconfigvariable type name, status codes, validation limits).

Copilot AI lite review requested due to automatic review settings September 8, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation examples contain inconsistencies/inaccuracies (notably paginated HAL fields and an impossible SHA-256 ETag example) that should be corrected before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds/updates REST contract documentation for new admin-only email template management and a dedicated system config variable endpoint, aligning the contract with the backend decision to decouple config variables from template payloads.

Changes:

  • Documented /api/system/emailtemplates including ETag-based optimistic concurrency and validation/status codes.
  • Added systemconfigvariables.md to document list and single-item retrieval of allowed template config variables.
  • Updated endpoints.md to link the new endpoint docs and added a coordinating PULL_REQUEST.md.
File summaries
File Description
systemconfigvariables.md New contract page for listing and retrieving allowed system config variables for templates
emailtemplates.md New/updated contract page for admin email template retrieval and update with ETag concurrency
endpoints.md Adds links to the newly documented endpoints
PULL_REQUEST.md Captures cross-repo references and a summary of the coordinated feature
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread PULL_REQUEST.md Outdated
## References

* Related to [DSpace/dspace-angular#5828](https://github.com/DSpace/dspace-angular/issues/5828)
* Backend implementation: [DSpace/DSpace](https://github.com/DSpace/DSpace) (Branch: `feature/admin-email-templates`)
Comment thread emailtemplates.md Outdated
}
],
"lastModified": "2026-09-05T12:00:00Z",
"etag": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
Comment thread systemconfigvariables.md Outdated

This endpoint exposes the general repository configuration variables that administrators may reference inside email templates (e.g. `${config.get('dspace.name')}`).

It returns the subset of configuration properties allowed in templates, as defined by `message.templates.allowed-config` (resolved via `Utils.getAllowedTemplateConfig()`, matching `Email.java` and `LDN.java`).
Comment thread systemconfigvariables.md
Comment on lines +22 to +39
{
"_embedded": {
"systemconfigvariables": [
{
"key": "dspace.name",
"value": "DSpace at My University",
"placeholder": "${config.get('dspace.name')}",
"type": "systemconfigvariable"
},
{
"key": "dspace.ui.url",
"value": "http://localhost:4000",
"placeholder": "${config.get('dspace.ui.url')}",
"type": "systemconfigvariable"
}
]
}
}
Part 2 of 3 for DSpace/dspace-angular#5828: REST contract for
/api/system/emailtemplates (ETag concurrency, 304/412/428, 400
validation) and /api/system/systemconfigvariables (allowed config
discovery, decoupled from template payloads).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

3 participants