Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit c570d3d

Browse files
committed
additional text for approval notification email added, with various links
to completed resources Signed-off-by: Neal Ensor <[email protected]>
1 parent 337fbf7 commit c570d3d

File tree

2 files changed

+48
-8
lines changed

2 files changed

+48
-8
lines changed

src/main/java/gov/osti/services/Metadata.java

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public class Metadata {
139139
private static String FILE_UPLOADS = DoeServletContextListener.getConfigurationProperty("file.uploads");
140140
// API path to archiver services if available
141141
private static String ARCHIVER_URL = DoeServletContextListener.getConfigurationProperty("archiver.url");
142+
// get the SITE URL base for applications
143+
private static String SITE_URL = DoeServletContextListener.getConfigurationProperty("site.url");
142144
// create and start a ConnectorFactory for use by "autopopulate" service
143145
static {
144146
try {
@@ -1690,19 +1692,57 @@ private static void sendApprovalNotification(DOECodeMetadata md) {
16901692
return;
16911693

16921694
try {
1695+
// get the OWNER information
1696+
User owner = UserServices.findUserByEmail(md.getOwner());
1697+
if (null==owner) {
1698+
log.warn("Unable to locate USER information for Code ID: " + md.getCodeId());
1699+
return;
1700+
}
1701+
16931702
email.setFrom(EMAIL_FROM);
1694-
email.setSubject("DOE CODE Record #" + md.getCodeId() + " has been Approved.");
1703+
email.setSubject("Approved -- DOE CODE ID: " + md.getCodeId() + ", " + md.getSoftwareTitle());
16951704
email.addTo(md.getOwner());
16961705

16971706
StringBuilder msg = new StringBuilder();
16981707

16991708
msg.append("<html>");
1700-
msg.append("Your DOE CODE record #")
1701-
.append(md.getCodeId())
1702-
.append(" entitled \"")
1703-
.append(md.getSoftwareTitle())
1704-
.append("\" has been approved on the DOE CODE service.");
1705-
msg.append("<P>It may now be found in the DOE CODE search application on the public access web site.");
1709+
msg.append("Dear ")
1710+
.append(owner.getFirstName())
1711+
.append(" ")
1712+
.append(owner.getLastName())
1713+
.append(":");
1714+
1715+
msg.append("<P>Thank you -- your submitted project, DOE CODE ID: <a href=\"")
1716+
.append(SITE_URL)
1717+
.append("/biblio/")
1718+
.append(md.getCodeId())
1719+
.append("\">")
1720+
.append(md.getCodeId())
1721+
.append("</a>, has been approved. It is now <a href=\"")
1722+
.append(SITE_URL)
1723+
.append("\">searchable</a> in DOE CODE by, for example, title or CODE ID #.</P>");
1724+
1725+
// OMIT the following for BUSINESS TYPE software
1726+
if (!DOECodeMetadata.Type.B.equals(md.getSoftwareType())) {
1727+
msg.append("<P>You may need to ")
1728+
.append("<a href=\"")
1729+
.append(SITE_URL)
1730+
.append("/announce?code_id=")
1731+
.append(md.getCodeId())
1732+
.append("\">continue editing your project</a> to announce it to the Department of Energy ")
1733+
.append("to ensure announcement and dissemination in accordance with DOE statutory responsibilities. For more information please see ")
1734+
.append("<a href=\"")
1735+
.append(SITE_URL)
1736+
.append("/faq#what-does-it-mean-to-announce\">What does it mean to announce scientific code to DOE CODE?</a></P>");
1737+
}
1738+
msg.append("<P>If you have questions such as What are the benefits of getting a DOI for code or software?, see the ")
1739+
.append("<a href=\"")
1740+
.append(SITE_URL)
1741+
.append("/faq\">DOE CODE FAQs</a>.</P>");
1742+
msg.append("<P>If we can be of assistance, please do not hesitate to <a href=\"mailto:[email protected]\">Contact Us</a>.</P>");
1743+
msg.append("<P>Sincerely,</P>");
1744+
msg.append("<P>Lynn Davis<BR/>Product Manager for DOE CODE<BR/>USDOE/OSTI</P>");
1745+
17061746
msg.append("</html>");
17071747

17081748
email.setHtmlMsg(msg.toString());

src/main/java/gov/osti/services/UserServices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ private static void sendPasswordExpiredEmail(String userEmail) {
16281628
* @param email the EMAIL to look for
16291629
* @return a User object if possible or null if not found or errors
16301630
*/
1631-
private static User findUserByEmail(String email) {
1631+
protected static User findUserByEmail(String email) {
16321632
EntityManager em = DoeServletContextListener.createEntityManager();
16331633

16341634
try {

0 commit comments

Comments
 (0)