Skip to content

Commit

Permalink
Merge pull request IQSS#10504 from PaulBoon/UseSupportEmailInClosingText
Browse files Browse the repository at this point in the history
10287: Use support email in the system email message 'closing' text
  • Loading branch information
pdurbin committed Sep 18, 2024
2 parents ec882e3 + 167799f commit 1fffec4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Notification Email Improvement

The system email text has been improved to use the support email address (`dataverse.mail.support-email`) in the text where it states; "contact us for support at", instead of the default system email address.
Using the system email address here was particularly problematic when it was a 'noreply' address.
2 changes: 2 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3066,6 +3066,8 @@ If not set, the :ref:`systemEmail` is used for the feedback API/contact form ema
Note that only the email address is required, which you can supply without the ``<`` and ``>`` signs, but if you include the text, it's the way to customize the name of your support team, which appears in the "from" address in emails as well as in help text in the UI.
If you don't include the text, the installation name (see :ref:`Branding Your Installation`) will appear in the "from" address.

Also note that the support email address is used at the end of notification mails where it states; "contact us for support at", followed by the support mail address if configured and the system email otherwise.

Can also be set via any `supported MicroProfile Config API source`_, e.g. the environment variable ``DATAVERSE_MAIL_SUPPORT_EMAIL``.

See also :ref:`smtp-config`.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/MailServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ public boolean sendSystemEmail(String to, String subject, String messageText, bo
return false;
}
InternetAddress systemAddress = optionalAddress.get();
InternetAddress supportAddress = getSupportAddress().orElse(systemAddress);

String body = messageText +
BundleUtil.getStringFromBundle(isHtmlContent ? "notification.email.closing.html" : "notification.email.closing",
List.of(BrandingUtil.getSupportTeamEmailAddress(systemAddress), BrandingUtil.getSupportTeamName(systemAddress)));
List.of(BrandingUtil.getSupportTeamEmailAddress(supportAddress), BrandingUtil.getSupportTeamName(supportAddress)));

logger.fine(() -> "Sending email to %s. Subject: <<<%s>>>. Body: %s".formatted(to, subject, body));
try {
Expand Down

0 comments on commit 1fffec4

Please sign in to comment.