mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Merge pull request #8484 from nibou230/copy-request-email-8451
Send email even if copy request is refused
This commit is contained in:
@@ -154,9 +154,9 @@ public class RequestItemEmailNotifier {
|
|||||||
email.setContent("body", message);
|
email.setContent("body", message);
|
||||||
email.setSubject(subject);
|
email.setSubject(subject);
|
||||||
email.addRecipient(ri.getReqEmail());
|
email.addRecipient(ri.getReqEmail());
|
||||||
if (ri.isAccept_request()) {
|
// Attach bitstreams.
|
||||||
// Attach bitstreams.
|
try {
|
||||||
try {
|
if (ri.isAccept_request()) {
|
||||||
if (ri.isAllfiles()) {
|
if (ri.isAllfiles()) {
|
||||||
Item item = ri.getItem();
|
Item item = ri.getItem();
|
||||||
List<Bundle> bundles = item.getBundles("ORIGINAL");
|
List<Bundle> bundles = item.getBundles("ORIGINAL");
|
||||||
@@ -179,11 +179,19 @@ public class RequestItemEmailNotifier {
|
|||||||
bitstream.getFormat(context).getMIMEType());
|
bitstream.getFormat(context).getMIMEType());
|
||||||
}
|
}
|
||||||
email.send();
|
email.send();
|
||||||
} catch (MessagingException | IOException | SQLException | AuthorizeException e) {
|
} else {
|
||||||
LOG.warn(LogHelper.getHeader(context,
|
boolean sendRejectEmail = configurationService
|
||||||
"error_mailing_requestItem", e.getMessage()));
|
.getBooleanProperty("request.item.reject.email", true);
|
||||||
throw new IOException("Reply not sent: " + e.getMessage());
|
// Not all sites want the "refusal" to be sent back to the requester via
|
||||||
|
// email. However, by default, the rejection email is sent back.
|
||||||
|
if (sendRejectEmail) {
|
||||||
|
email.send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (MessagingException | IOException | SQLException | AuthorizeException e) {
|
||||||
|
LOG.warn(LogHelper.getHeader(context,
|
||||||
|
"error_mailing_requestItem", e.getMessage()));
|
||||||
|
throw new IOException("Reply not sent: " + e.getMessage());
|
||||||
}
|
}
|
||||||
LOG.info(LogHelper.getHeader(context,
|
LOG.info(LogHelper.getHeader(context,
|
||||||
"sent_attach_requestItem", "token={}"), ri.getToken());
|
"sent_attach_requestItem", "token={}"), ri.getToken());
|
||||||
|
@@ -1549,6 +1549,10 @@ log.report.dir = ${dspace.dir}/log
|
|||||||
request.item.type = all
|
request.item.type = all
|
||||||
# Should all Request Copy emails go to the helpdesk instead of the item submitter?
|
# Should all Request Copy emails go to the helpdesk instead of the item submitter?
|
||||||
request.item.helpdesk.override = false
|
request.item.helpdesk.override = false
|
||||||
|
# Should a rejection of a copy request send an email back to the requester?
|
||||||
|
# Defaults to "true", which means a rejection email is sent back.
|
||||||
|
# Setting it to "false" results in a silent rejection.
|
||||||
|
request.item.reject.email = true
|
||||||
|
|
||||||
#------------------------------------------------------------------#
|
#------------------------------------------------------------------#
|
||||||
#------------------SUBMISSION CONFIGURATION------------------------#
|
#------------------SUBMISSION CONFIGURATION------------------------#
|
||||||
|
Reference in New Issue
Block a user