added email notifications

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@68595 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-01-31 00:51:17 +00:00
parent 04bff11cee
commit 83311117df
1 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import javax.mail.internet.MimeMessage;
import org.gcube.common.core.utils.logging.GCUBEClientLog;
import org.gcube.portal.custom.communitymanager.OrganizationsUtil;
import org.gcube.portal.databook.shared.Notification;
import org.gcube.portal.databook.shared.NotificationType;
import com.liferay.portal.model.UserModel;
import com.liferay.portal.service.UserLocalServiceUtil;
@ -32,9 +33,13 @@ public class EmailPlugin {
removeMarkup = removeMarkup.replaceAll(">", ">");
removeMarkup = removeMarkup.replaceAll("&lt;", "<");
String sender = notification2Save.getSenderFullName();
if (notification2Save.getType() == NotificationType.DOCUMENT_WORKFLOW_STEP_REQUEST_TASK)
sender = "";
return "<body>" +
"<br />Hi " + userFirstName + "," +
"<p>" + notification2Save.getSenderFullName() + " " + removeMarkup + "</p>" +
"<p>" + sender + " " + removeMarkup + "</p>" +
"<br /><p>See this at <a href=\"portalUrl\">" + portalUrl + "</a>" +
"<br /><p><div style=\"color:#999999; font-size:11px; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; padding-top:30px;\">" +
"This message was sent to <a href=\"mailto:"+email+"\" style=\"color:#3b5998;text-decoration:none\" target=\"_blank\">"+email+"</a>. " +