Skip to content

Commit

Permalink
User feedback API fixes:
Browse files Browse the repository at this point in the history
- Update mail message, related to geonetwork#6792.
- Don't fail the user feedback creation if the mail server is not configured
  • Loading branch information
josegar74 authored and fxprunayre committed Sep 19, 2023
1 parent 05dbac8 commit 68f7829
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,18 @@ public ResponseEntity newUserFeedback(
String title = XslUtil.getIndexField(null, userFeedbackDto.getMetadataUUID(), "resourceTitleObject", "");

if (toAddress.size() > 0) {
MailUtil.sendMail(toAddress,
String.format(
messages.getString("new_user_rating"),
catalogueName, title),
String.format(
messages.getString("new_user_rating_text"),
metadataUtils.getDefaultUrl(userFeedbackDto.getMetadataUUID(), locale.getISO3Language())),
settingManager);
try {
MailUtil.sendMail(toAddress,
String.format(
messages.getString("new_user_rating"),
catalogueName, title),
String.format(
messages.getString("new_user_rating_text"),
metadataUtils.getDefaultUrl(userFeedbackDto.getMetadataUUID(), locale.getISO3Language())),
settingManager);
} catch (IllegalArgumentException ex) {
Log.warning(API.LOG_MODULE_NAME, ex.getMessage(), ex);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ register_email_message=Dear User,\n\
Yours sincerely,\n\
The %s team.
new_user_rating=%s / New user rating on %s
new_user_rating_text=See record %sapi/records/%s
new_user_rating_text=See record %s
user_feedback_title=%s / User feedback on %s / %s
user_feedback_text=User %s (%s - %s)\n\
- Email: %s\n\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ register_email_message=Cher utilisateur,\n\
Salutations,\n\
L'\u00E9quipe %s.
new_user_rating=%s / Nouvelle \u00E9valuation faite pour %s
new_user_rating_text=Consulter la fiche %sapi/records/%s
new_user_rating_text=Consulter la fiche %s
user_feedback_title=%s / Nouveau commentaire sur %s / %s
user_feedback_text=Utilisateur %s (%s - %s)\n\
- Email: %s\n\
Expand Down

0 comments on commit 68f7829

Please sign in to comment.