Skip to content

[publication] Fix submission notification text to attribute the submitter#10864

Open
Cryptoteep wants to merge 1 commit into
aces:mainfrom
Cryptoteep:fix/publication-submission-notification-text
Open

[publication] Fix submission notification text to attribute the submitter#10864
Cryptoteep wants to merge 1 commit into
aces:mainfrom
Cryptoteep:fix/publication-submission-notification-text

Conversation

@Cryptoteep

Copy link
Copy Markdown

Summary

Fixes #10852.

When a user enables "notify me of new publication submissions" in
my_preferences and a different user submits a new publication
proposal, the notification email received by the first user was worded
as a first-person confirmation:

This is to confirm the project proposal "..." received on ...
We will notify you once this proposal has been reviewed.

This reads as though the recipient themselves submitted the proposal,
which is confusing/incorrect when the recipient is actually being
notified about someone else's submission.

modules/publication/ajax/FileUpload.php's notify() function already
builds a User value (the submitter's full name) and passes it into the
template data for notifier_publication_submission.tpl, but the
template never used that variable. This mirrors the existing
notifier_publication_edit.tpl, which correctly says "... has been
edited by {$User}."

Changes

  • smarty/templates/email/notifier_publication_submission.tpl: reword
    the notification to state who submitted the proposal, using the
    already-available {$User} variable, and drop the "This is to
    confirm ... we will notify you" phrasing that implied the recipient
    was the submitter.
  • test/unittests/PublicationSubmissionNotificationTemplateTest.php:
    new unit test that renders the template's placeholders with sample
    data and asserts:
    • the rendered text attributes the submission to the actual
      submitter's name,
    • the misleading "this is to confirm" wording is gone,
    • all placeholders expected by FileUpload.php::notify() (Title,
      Date, User, ProjectName) are still present in the template.

No PHP logic changed — FileUpload.php already assembled and passed
the User value; only the template text was wrong.

Test plan

  • Added test/unittests/PublicationSubmissionNotificationTemplateTest.php,
    a pure-PHP unit test (no DB/Smarty bootstrap required) that
    simulates the {$Var} substitution performed by Email::send()
    and asserts on the resulting text.
  • Could not execute vendor/bin/phpunit / composer test in the
    sandbox used to prepare this PR (no PHP/composer toolchain
    available in that environment). The test was manually verified by
    reproducing the same substitution logic in a standalone script
    against the real template file, confirming the assertions pass.
    Please run the LORIS unit test suite (test/unittests.sh /
    phpunit --testsuite LorisUnitTests) in CI to confirm.

…tter

Notification recipients (e.g. users with "new publication submission"
notifications enabled) received an email worded as a first-person
confirmation ("This is to confirm the project proposal... We will
notify you once this proposal has been reviewed"), which reads as
though the recipient themselves submitted the proposal even when a
different user actually submitted it.

Update notifier_publication_submission.tpl to use the already-available
$User template variable, consistent with notifier_publication_edit.tpl,
so the email correctly states who submitted the proposal.

Adds a unit test covering the rendered notification text.

Fixes aces#10852
@github-actions github-actions Bot added the Language: PHP PR or issue that update PHP code label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[publication] Submission notification text is off

1 participant