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
This commit is contained in:
Massimiliano Assante 2015-07-09 15:20:13 +00:00
parent aa8f0fe59b
commit 79c5b84b4e
2 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,7 @@
<ReleaseNotes>
<Changeset component="org.gcube.applicationsupportlayer.aslsocial.0-14-0"
date="2015-06-18">
date="2015-07-08">
<Change>Added Support for user reply via mail to post and comment notifications</Change>
<Change>Added Notifications support for Tabular Data Manager</Change>
</Changeset>
<Changeset component="org.gcube.applicationsupportlayer.aslsocial.0-13-1"

View File

@ -35,7 +35,7 @@ public class EmailPlugin {
private static final Logger _log = LoggerFactory.getLogger(EmailPlugin.class);
protected static final int SECONDS2WAIT = 60;
public static final String WRITE_ABOVE_TO_REPLY = "- Write ABOVE THIS LINE to post a reply via email -";
public static final String WRITE_ABOVE_TO_REPLY = "- Write anywhere ABOVE THIS LINE to post a reply via email -";
private static EmailPlugin singleton;
@ -78,7 +78,9 @@ public class EmailPlugin {
body.append("<body>");
if (notification2Save.getType() == NotificationType.POST_ALERT) {
if (notification2Save.getType() == NotificationType.POST_ALERT ||
notification2Save.getType() == NotificationType.COMMENT ||
notification2Save.getType() == NotificationType.OWN_COMMENT) {
body.append("<div>").append(WRITE_ABOVE_TO_REPLY).append("</div><br />");
}
@ -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 <user>
@ -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");