Skip to content

Commit

Permalink
New link and subject should contain the orcid id (ORCID#7175)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro authored Jan 6, 2025
1 parent 7aa3e60 commit 174bb2a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Client ID: ${clientId}

Please remember that the ORCID Public API is free for non-commercial use by individuals as stated in the Public APIs Terms of Service (https://info.orcid.org/public-client-terms-of-service). By "non-commercial" we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service.

Based on your API usage, we highly recommend you consider becoming an ORCID member for access to our Member API (https://info.orcid.org/documentation/features/member-api/). Not only will it allow you to access a higher Rate Limits and an unrestricted Usage Quota, but you will be able to access Trusted Party data in ORCID records and contribute data to ORCID records from your institutional systems.
Based on your API usage, we highly recommend you consider becoming an ORCID member for access to our Member API (https://info.orcid.org/what-is-orcid/services/member-api/). Not only will it allow you to access a higher Rate Limits and an unrestricted Usage Quota, but you will be able to access Trusted Party data in ORCID records and contribute data to ORCID records from your institutional systems.

To minimize any disruption to your ORCID integration in the future, we would recommend that you reach out to our Engagement Team by replying to this email to discuss our ORCID membership options.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<p style="font-family: arial, helvetica, sans-serif;font-size: 15px;color: #494A4C; white-space: pre;">Client ID: ${clientId}</p>
<br/>
<p style="font-family: arial, helvetica, sans-serif;font-size: 15px;color: #494A4C; white-space: pre;">Please remember that the ORCID Public API is free for non-commercial use by individuals as stated in the <a href="https://info.orcid.org/public-client-terms-of-service/" target="_blank">Public APIs Terms of Service</a>. By "non-commercial" we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service.</p>
<p style="font-family: arial, helvetica, sans-serif;font-size: 15px;color: #494A4C; white-space: pre;">Based on your API usage, we highly recommend you consider becoming an ORCID member for access to our <a href="https://info.orcid.org/documentation/features/member-api/" target="_blank">Member API</a>. Not only will it allow you to access a higher Rate Limits and an unrestricted Usage Quota, but you will be able to access Trusted Party data in ORCID records and contribute data to ORCID records from your institutional systems.</p>
<p style="font-family: arial, helvetica, sans-serif;font-size: 15px;color: #494A4C; white-space: pre;">Based on your API usage, we highly recommend you consider becoming an ORCID member for access to our <a href="https://info.orcid.org/what-is-orcid/services/member-api/" target="_blank">Member API</a>. Not only will it allow you to access a higher Rate Limits and an unrestricted Usage Quota, but you will be able to access Trusted Party data in ORCID records and contribute data to ORCID records from your institutional systems.</p>
<p style="font-family: arial, helvetica, sans-serif;font-size: 15px;color: #494A4C; white-space: pre;">To minimize any disruption to your ORCID integration in the future, we would recommend that you reach out to our Engagement Team by replying to this email to discuss our ORCID membership options.
<p style="font-family: arial, helvetica, sans-serif;font-size: 15px;color: #494A4C;">
<#include "email_footer_html.ftl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class ApiRateLimitFilter extends OncePerRequestFilter {
+ "You can increase your daily quota by registering for and using Public API client credentials "
+ "(https://info.orcid.org/documentation/integration-guide/registering-a-public-api-client/)";

private static final String SUBJECT = "[ORCID-API] WARNING! You have exceeded the daily Public API Usage Limit - ";
private static final String SUBJECT = "[ORCID-API] WARNING! You have exceeded the daily Public API Usage Limit - ({ORCID-ID})";

@Value("${org.orcid.papi.rate.limit.fromEmail:[email protected]}")
private String FROM_ADDRESS;
Expand Down Expand Up @@ -230,7 +230,7 @@ private Map<String, Object> createTemplateParams(String clientId, String clientN
templateParams.put("locale", LocaleUtils.toLocale("en"));
templateParams.put("baseUri", orcidUrlManager.getBaseUrl());
templateParams.put("baseUriHttp", orcidUrlManager.getBaseUriHttp());
templateParams.put("subject", SUBJECT + orcidId);
templateParams.put("subject", SUBJECT.replace("{ORCID-ID}", orcidId));
return templateParams;
}

Expand All @@ -256,8 +256,9 @@ private void sendEmail(String clientId, LocalDate requestDate) {
setPapiRateExceededItemInPanoply(item);
}

String subject = templateParams.containsKey("subject") ? ((String) templateParams.get("subject")) : SUBJECT;
// Send the email
boolean mailSent = mailGunManager.sendEmailWithCC(FROM_ADDRESS, email, CC_ADDRESS, SUBJECT, body, html);
boolean mailSent = mailGunManager.sendEmailWithCC(FROM_ADDRESS, email, CC_ADDRESS, subject, body, html);
if (!mailSent) {
LOG.error("Failed to send email for papi limits, orcid=" + memberId + " email: " + email);
}
Expand Down

0 comments on commit 174bb2a

Please sign in to comment.