Skip to content

Commit

Permalink
IQSS#3702 - Increased maxlength of message to 2000 + Added email cont…
Browse files Browse the repository at this point in the history
…acts of collection in return to author email
  • Loading branch information
luddaniel committed Nov 29, 2023
1 parent caf5f67 commit 36a259f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
19 changes: 14 additions & 5 deletions src/main/java/edu/harvard/iq/dataverse/MailServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,24 @@ public String getMessageTextBasedOnNotification(UserNotification userNotificatio
case RETURNEDDS:
version = (DatasetVersion) targetObject;
pattern = BundleUtil.getStringFromBundle("notification.email.wasReturnedByReviewer");
String optionalReturnReason = "";

String[] paramArrayReturnedDataset = {version.getDataset().getDisplayName(), getDatasetDraftLink(version.getDataset()),
version.getDataset().getOwner().getDisplayName(), getDataverseLink(version.getDataset().getOwner())};
messageText += MessageFormat.format(pattern, paramArrayReturnedDataset);

if (comment != null && !comment.isEmpty()) {
optionalReturnReason = ".\n\n" + MessageFormat.format(BundleUtil.getStringFromBundle("notification.email.wasReturnedByReviewerReason"), comment);
messageText += "\n\n" + MessageFormat.format(BundleUtil.getStringFromBundle("notification.email.wasReturnedByReviewerReason"), comment);
}

String[] paramArrayReturnedDataset = {version.getDataset().getDisplayName(), getDatasetDraftLink(version.getDataset()),
version.getDataset().getOwner().getDisplayName(), getDataverseLink(version.getDataset().getOwner()), optionalReturnReason};
messageText += MessageFormat.format(pattern, paramArrayReturnedDataset);
Dataverse d = (Dataverse) version.getDataset().getOwner();
List<String> contactEmailList = new ArrayList<String>();
for (DataverseContact dc : d.getDataverseContacts()) {
contactEmailList.add(dc.getContactEmail());
}
if (!contactEmailList.isEmpty()) {
String contactEmails = String.join(", ", contactEmailList);
messageText += "\n\n" + MessageFormat.format(BundleUtil.getStringFromBundle("notification.email.wasReturnedByReviewer.collectionContacts"), contactEmails);
}
return messageText;

case WORKFLOW_SUCCESS:
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,9 @@ notification.email.createDataverse=Your new dataverse named {0} (view at {1} ) w
# Bundle file editors, please note that "notification.email.createDataset" is used in a unit test
notification.email.createDataset=Your new dataset named {0} (view at {1} ) was created in {2} (view at {3} ). To learn more about what you can do with a dataset, check out the Dataset Management - User Guide at {4}/{5}/user/dataset-management.html .
notification.email.wasSubmittedForReview={0} (view at {1} ) was submitted for review to be published in {2} (view at {3} ). Don''t forget to publish it or send it back to the contributor, {4} ({5})\!
notification.email.wasReturnedByReviewer={0} (view at {1} ) was returned by the curator of {2} (view at {3} ).{4}
notification.email.wasReturnedByReviewerReason=See the curator comment: {0}
notification.email.wasReturnedByReviewer={0} (view at {1} ) was returned by the curator of {2} (view at {3} ).
notification.email.wasReturnedByReviewerReason=Here is the curator comment: {0}
notification.email.wasReturnedByReviewer.collectionContacts=You may contact the collection administrator for more information: {0}
notification.email.wasPublished={0} (view at {1} ) was published in {2} (view at {3} ).
notification.email.publishFailedPidReg={0} (view at {1} ) in {2} (view at {3} ) could not be published due to a failure to register, or update the Global Identifier for the dataset or one of the files in it. Contact support if this continues to happen.
notification.email.closing=\n\nYou may contact us for support at {0}.\n\nThank you,\n{1}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@
<span class="glyphicon glyphicon-warning-sign"/> #{bundle['dataset.rejectMessage']}
</p>

<p:inputTextarea id="returnReason" rows="3" value="#{DatasetPage.returnReason}" title="#{bundle['dataset.rejectMessage.label']}" maxlength="200" widgetVar="returnReason"
<p:inputTextarea id="returnReason" rows="4" value="#{DatasetPage.returnReason}" title="#{bundle['dataset.rejectMessage.label']}" maxlength="2000" widgetVar="returnReason"
cols="70" counter="display" counterTemplate="{0} characters remaining." autoResize="false"
required="#{param['DO_RETURN_TO_AUTHOR_VALIDATION']}"
requiredMessage="#{bundle['dataset.reject.enterReason.error']}"/>
Expand Down

0 comments on commit 36a259f

Please sign in to comment.