@@ -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 ());
0 commit comments