Commit 6ddea5bd authored by Piotr Gawron's avatar Piotr Gawron
Browse files

info about affected project is in the email

parent 4627316a
......@@ -6,6 +6,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
(#813)
* Small improvement: setting "Modify project| checkbox automatically select
"View project" checkbox when editing privileges (#920)
* Small improvement: notification email uses minerva name and id of affected
project (#926)
* Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
......
......@@ -327,8 +327,10 @@ public class LayoutService implements ILayoutService {
layoutDao.update(layout);
try {
getEmailSender().sendEmail("MapViewer status", "There was a problem with generating layout "
+ params.getName() + ". Contact administrator to solve this issue.", params.getUser());
getEmailSender().sendEmail("Minerva status",
"Project: " + params.getProject().getProjectId() + ". There was a problem with generating layout "
+ params.getName() + ". Contact administrator to solve this issue.",
params.getUser());
} catch (MessagingException e1) {
logger.error("Problem with sending email", e1);
}
......@@ -523,7 +525,7 @@ public class LayoutService implements ILayoutService {
*/
protected void sendSuccesfullRemoveEmail(String projectId, String layoutName, String email)
throws MessagingException {
getEmailSender().sendEmail("MapViewer notification", "Layout " + layoutName +
getEmailSender().sendEmail("Minerva notification", "Layout " + layoutName +
" in map " + projectId + " was successfully removed.<br/>", email);
}
......@@ -539,14 +541,15 @@ public class LayoutService implements ILayoutService {
*/
protected void sendSuccessfullGenerationEmail(final CreateLayoutParams params, final Collection<ColorSchema> schemas)
throws MessagingException {
StringBuilder content = new StringBuilder("Layout " + params.getName() + " generated successfully.\n");
StringBuilder content = new StringBuilder("Project: " + params.getProject().getProjectId() + ".\n");
content.append("Layout " + params.getName() + " generated successfully.\n");
content.append("Result of coloring:<br/>");
String table = prepareTableResult(schemas, new ColorSchemaReader());
content.append(table);
String email = params.getProject().getNotifyEmail();
if (params.getUser() != null) { // send email to a user who owns the layout
getEmailSender().sendEmail("MapViewer notification", content.toString(), params.getUser());
getEmailSender().sendEmail("Minerva notification", content.toString(), params.getUser());
// send email to the model owner
if (email != null && !email.equals(params.getUser().getEmail())) {
......@@ -561,11 +564,11 @@ public class LayoutService implements ILayoutService {
.append(params.getProject().getProjectId())
.append(" map.");
getEmailSender().sendEmail("MapViewer notification", content.toString(), email);
getEmailSender().sendEmail("Minerva notification", content.toString(), email);
}
} else if (email != null) {
// if nobody owns the layout then send it to the model owner
getEmailSender().sendEmail("MapViewer notification", content.toString(), email);
getEmailSender().sendEmail("Minerva notification", content.toString(), email);
}
}
......
......@@ -993,13 +993,13 @@ public class ProjectService implements IProjectService {
* @param projectId
* identifier of the project
* @param email
* otification email
* notification email
* @throws MessagingException
* thrown when there is a problem with sending email
*/
protected void sendSuccesfullRemoveEmail(String projectId, String email) throws MessagingException {
EmailSender emailSender = new EmailSender(configurationService);
emailSender.sendEmail("MapViewer notification", "Map " + projectId + " was successfully removed.<br/>", email);
emailSender.sendEmail("Minerva notification", "Map " + projectId + " was successfully removed.<br/>", email);
}
/**
......@@ -1018,7 +1018,7 @@ public class ProjectService implements IProjectService {
content.append("There was a problem with generating ").append(projectName).append(" map.<br/>");
content.append(e.getClass().getName()).append(": ").append(e.getMessage());
try {
emailSender.sendEmail("MapViewer notification", content.toString(), email);
emailSender.sendEmail("Minerva notification", content.toString(), email);
} catch (MessagingException e1) {
logger.error(e1);
}
......@@ -1034,7 +1034,8 @@ public class ProjectService implements IProjectService {
*/
protected void sendSuccesfullEmail(Model originalModel) throws MessagingException {
EmailSender emailSender = new EmailSender(configurationService);
emailSender.sendEmail("MapViewer notification", "Your map was generated successfully.<br/>",
emailSender.sendEmail("Minerva notification",
"Your map " + originalModel.getProject().getProjectId() + " was generated successfully.<br/>",
originalModel.getProject().getNotifyEmail());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment