From 53eeed490e3a1232f31c4cf7069cc4b8408d8887 Mon Sep 17 00:00:00 2001 From: "aliaksei.bykau" Date: Fri, 22 Dec 2023 08:18:43 +0100 Subject: [PATCH] [DSC-1435] improve for email template for subscriptions_content and email about subscribed statistics update. --- .../main/java/org/dspace/subscriptions/ContentGenerator.java | 2 +- .../java/org/dspace/subscriptions/StatisticsGenerator.java | 4 +++- dspace/config/emails/subscriptions_content | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/subscriptions/ContentGenerator.java b/dspace-api/src/main/java/org/dspace/subscriptions/ContentGenerator.java index 80e329ff63f4..65f1ae9dcf9b 100644 --- a/dspace-api/src/main/java/org/dspace/subscriptions/ContentGenerator.java +++ b/dspace-api/src/main/java/org/dspace/subscriptions/ContentGenerator.java @@ -85,7 +85,7 @@ private String generateBodyMail(String type, List subscription for (SubscriptionItem item : subscriptionItems) { out.write("\n".getBytes(UTF_8)); out.write("List of new content for the\n".getBytes(UTF_8)); - out.write((type + " " + item.getName() + " - " + item.getUrl() + "\n") + out.write((type + " \"" + item.getName() + "\" - " + item.getUrl() + "\n") .getBytes(UTF_8)); for (Entry entry : item.getItemUrlsByItemName().entrySet()) { diff --git a/dspace-api/src/main/java/org/dspace/subscriptions/StatisticsGenerator.java b/dspace-api/src/main/java/org/dspace/subscriptions/StatisticsGenerator.java index 842ff9aa0e8f..43ff6b71d4b5 100644 --- a/dspace-api/src/main/java/org/dspace/subscriptions/StatisticsGenerator.java +++ b/dspace-api/src/main/java/org/dspace/subscriptions/StatisticsGenerator.java @@ -51,8 +51,10 @@ public void notifyForSubscriptions(Context c, EPerson ePerson, List String name = configurationService.getProperty("dspace.name"); File attachment = generateExcel(crisMetricsList, c); email.addAttachment(attachment, "subscriptions.xlsx"); + email.setSubject(name + ": Statistics of records which you are subscribed"); email.setContent("intro", - "This automatic email is sent by " + name + " based on the subscribed statistics updates."); + "This automatic email is sent by " + name + " based on the subscribed statistics updates.\n\n" + + "See additional details in the file attached."); email.send(); } } catch (Exception ex) { diff --git a/dspace/config/emails/subscriptions_content b/dspace/config/emails/subscriptions_content index e76c8c311a4f..9d2d255c06d3 100644 --- a/dspace/config/emails/subscriptions_content +++ b/dspace/config/emails/subscriptions_content @@ -4,6 +4,7 @@ ## {1} Collections updates block ## {2} Communities updates block ## {3} Entity updates block +#set($subject = "${config.get('dspace.name')}: Statistics of updates on subscribed items") This email is sent from ${config.get('dspace.name')} based on the chosen subscription preferences. You can manage your subscription preferences from ${params[0]}