Skip to content

Commit

Permalink
Merged in DSC-1435 (pull request DSpace#1470)
Browse files Browse the repository at this point in the history
[DSC-1435] improve for email template for subscriptions_content and email about subscribed statistics update.

Approved-by: Daniele Ninfo
  • Loading branch information
Alex Bykau authored and danieleninfo committed Jan 5, 2024
2 parents bcaed9b + 53eeed4 commit 6805272
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private String generateBodyMail(String type, List<SubscriptionItem> 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<String, String> entry : item.getItemUrlsByItemName().entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public void notifyForSubscriptions(Context c, EPerson ePerson, List<CrisMetrics>
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) {
Expand Down
1 change: 1 addition & 0 deletions dspace/config/emails/subscriptions_content
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
Expand Down

0 comments on commit 6805272

Please sign in to comment.