From 79c5b84b4e46fcbd720d541cc64b6534b1506e78 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Thu, 9 Jul 2015 15:20:13 +0000 Subject: [PATCH] Added Support for user reply via mail to post and comment notifications git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@117130 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 3 ++- .../social/mailing/EmailPlugin.java | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/distro/changelog.xml b/distro/changelog.xml index fb2dca1..94b6c4a 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,6 +1,7 @@ + date="2015-07-08"> + Added Support for user reply via mail to post and comment notifications Added Notifications support for Tabular Data Manager "); - if (notification2Save.getType() == NotificationType.POST_ALERT) { + if (notification2Save.getType() == NotificationType.POST_ALERT || + notification2Save.getType() == NotificationType.COMMENT || + notification2Save.getType() == NotificationType.OWN_COMMENT) { body.append("
").append(WRITE_ABOVE_TO_REPLY).append("

"); } @@ -128,8 +130,10 @@ public class EmailPlugin { StringBuilder body = new StringBuilder(); - if (notification2Save.getType() == NotificationType.POST_ALERT) { - body.append(WRITE_ABOVE_TO_REPLY).append("\n\n"); + if (notification2Save.getType() == NotificationType.POST_ALERT || + notification2Save.getType() == NotificationType.COMMENT || + notification2Save.getType() == NotificationType.OWN_COMMENT) { + body.append(WRITE_ABOVE_TO_REPLY).append("\n\n"); } body.append("Dear ").append(userFirstName).append(",") //dear @@ -230,8 +234,10 @@ public class EmailPlugin { Message msg2Return = new MimeMessage(session); - if (notification2Save.getType() == NotificationType.POST_ALERT) { - senderEmail = "social.post@d4science.org"; + if (notification2Save.getType() == NotificationType.POST_ALERT || + notification2Save.getType() == NotificationType.COMMENT || + notification2Save.getType() == NotificationType.OWN_COMMENT) { + senderEmail = "social.post+" + notification2Save.getSubjectid() +"@d4science.org"; } // EMAIL SENDER msg2Return.setHeader("Content-Type", "text/html; charset=UTF-8");