From 81a2bcbff767e1f562316530814752c1a1dbc42c Mon Sep 17 00:00:00 2001 From: Camelia Dumitru Date: Fri, 8 Nov 2024 15:15:03 +0000 Subject: [PATCH 1/2] Added a notify email address --- .../main/java/org/orcid/api/filters/ApiRateLimitFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java index 58779274a4..a2969496af 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java @@ -104,7 +104,9 @@ public class ApiRateLimitFilter extends OncePerRequestFilter { + "(https://info.orcid.org/documentation/integration-guide/registering-a-public-api-client/ )"; private static final String SUBJECT = "[ORCID] You have exceeded the daily Public API Usage Limit - "; - private static final String FROM_ADDRESS = "\"Engagement Team, ORCID\" "; + + @Value("${org.orcid.papi.rate.limit.fromEmail:notify@notify.orcid.org}") + private String FROM_ADDRESS; @Override protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) From 0912bf2df1553aacfb2af7fb3b6573cb745e6093 Mon Sep 17 00:00:00 2001 From: Camelia Dumitru Date: Fri, 8 Nov 2024 15:16:52 +0000 Subject: [PATCH 2/2] logging from address --- .../src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java index a2969496af..1801ef7965 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java @@ -232,7 +232,7 @@ private void sendEmail(String clientId, LocalDate requestDate) { // Generate html from template String html = templateManager.processTemplate("papi_rate_limit_email_html.ftl", templateParams); String email = emailManager.findPrimaryEmail(profile.getId()).getEmail(); - + LOG.info("from address={}", FROM_ADDRESS); LOG.info("text email={}", body); LOG.info("html email={}", html); if (enablePanoplyPapiExceededRateInProduction) {