Skip to content

Commit

Permalink
Merge pull request DSpace#9527 from DSpace/backport-9387-to-main
Browse files Browse the repository at this point in the history
[Port main] Fix DSpace#9383: Set email subject for request copy form
  • Loading branch information
tdonohue authored May 1, 2024
2 parents 5c0d997 + e528ef4 commit af4d28f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dspace-api/src/main/java/org/dspace/core/Email.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public void send() throws MessagingException, IOException {
for (String headerName : templateHeaders) {
String headerValue = (String) vctx.get(headerName);
if ("subject".equalsIgnoreCase(headerName)) {
if (null != headerValue) {
if ((subject == null || subject.isEmpty()) && null != headerValue) {
subject = headerValue;
}
} else if ("charset".equalsIgnoreCase(headerName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,15 @@ public RequestItemRest put(Context context, HttpServletRequest request,
message = responseMessageNode.asText();
}

JsonNode responseSubjectNode = requestBody.findValue("subject");
String subject = null;
if (responseSubjectNode != null && !responseSubjectNode.isNull()) {
subject = responseSubjectNode.asText();
}
ri.setDecision_date(new Date());
requestItemService.update(context, ri);

// Send the response email
String subject = requestBody.findValue("subject").asText();
try {
requestItemEmailNotifier.sendResponse(context, ri, subject, message);
} catch (IOException ex) {
Expand Down

0 comments on commit af4d28f

Please sign in to comment.