Skip to content

Commit

Permalink
make "create dataverse" email subject dynamic #3611 #2710
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Jun 7, 2017
1 parent e8fdd34 commit 4550e4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ harvestserver.viewEditDialog.btn.save=Save Changes

#MailServiceBean.java

notification.email.create.dataverse.subject=Dataverse: Your dataverse has been created
notification.email.create.dataverse.subject={0}: Your dataverse has been created
notification.email.create.dataset.subject=Dataverse: Your dataset has been created
notification.email.request.file.access.subject=Dataverse: Access has been requested for a restricted file
notification.email.grant.file.access.subject=Dataverse: You have been granted access to restricted file
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/util/MailUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static String getSubjectTextBasedOnNotification(UserNotification userNoti
case REVOKEROLE:
return ResourceBundle.getBundle("Bundle").getString("notification.email.revoke.role.subject");
case CREATEDV:
return ResourceBundle.getBundle("Bundle").getString("notification.email.create.dataverse.subject");
return BundleUtil.getStringFromBundle("notification.email.create.dataverse.subject", Arrays.asList(BrandingUtil.getInstallationBrandName(rootDataverseName)));
case REQUESTFILEACCESS:
return ResourceBundle.getBundle("Bundle").getString("notification.email.request.file.access.subject");
case GRANTFILEACCESS:
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/edu/harvard/iq/dataverse/util/MailUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ public void testSubjectAssignRole() {
assertEquals("Dataverse: You have been assigned a role", MailUtil.getSubjectTextBasedOnNotification(userNotification, rootDataverseName));
}

@Test
public void testSubjectCreateDataverse() {
userNotification.setType(UserNotification.Type.CREATEDV);
assertEquals("LibraScholar: Your dataverse has been created", MailUtil.getSubjectTextBasedOnNotification(userNotification, rootDataverseName));
}
}

0 comments on commit 4550e4d

Please sign in to comment.