From 7a637e6871134a3d81cc9abbbe158090bdcec6f0 Mon Sep 17 00:00:00 2001 From: Roy Bruschini Date: Mon, 25 Mar 2024 16:52:55 +0100 Subject: [PATCH] Create templates mail and renamed name in getEmailFileName --- .../app/itemimport/ItemImportServiceImpl.java | 4 ++-- dspace/config/emails/batch_import_error | 19 +++++++++++++++++++ dspace/config/emails/batch_import_success | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 dspace/config/emails/batch_import_error create mode 100644 dspace/config/emails/batch_import_success diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java index 255f4bdcbb15..b2388d8a0fca 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java @@ -2233,7 +2233,7 @@ public void emailSuccessMessage(Context context, EPerson eperson, String fileName) throws MessagingException { try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); - Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_success")); + Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "batch_import_success")); email.addRecipient(eperson.getEmail()); email.addArgument(fileName); @@ -2249,7 +2249,7 @@ public void emailErrorMessage(EPerson eperson, String error) logError("An error occurred during item import, the user will be notified. " + error); try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); - Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_error")); + Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "batch_import_error")); email.addRecipient(eperson.getEmail()); email.addArgument(error); email.addArgument(configurationService.getProperty("dspace.ui.url") + "/feedback"); diff --git a/dspace/config/emails/batch_import_error b/dspace/config/emails/batch_import_error new file mode 100644 index 000000000000..2e2a2b742720 --- /dev/null +++ b/dspace/config/emails/batch_import_error @@ -0,0 +1,19 @@ +## Email sent to DSpace users when they batch import fails. +## +## Parameters: {0} the export error +## {1} the URL to the feedback page +## +## +## See org.dspace.core.Email for information on the format of this file. +## +#set($subject = 'DSpace - The batch import was not completed.') +The batch import you initiated from the DSpace UI was not completed, due to the following reason: + ${params[0]} + +For more information you may contact your system administrator: + ${params[1]} + + + +The DSpace Team + diff --git a/dspace/config/emails/batch_import_success b/dspace/config/emails/batch_import_success new file mode 100644 index 000000000000..7e9fdbf7416a --- /dev/null +++ b/dspace/config/emails/batch_import_success @@ -0,0 +1,16 @@ + +## Email sent to DSpace users when they successfully batch import items. +## +## Parameters: {0} the filepath to the mapfile created by the batch import +## +## +## See org.dspace.core.Email for information on the format of this file. +## +#set($subject = 'DSpace - Batch import successfully completed') +The batch item import you initiated from the DSpace UI has completed successfully. + +You may find the mapfile for the import in the following path: ${params[0]} + + +The DSpace Team +