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

Commit 1e95d96

Browse files
author
sowerstl
committed
Add site information to the notification email; (DOECODE-679)
1 parent e3270fd commit 1e95d96

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,6 +2332,16 @@ private static void sendStatusNotification(DOECodeMetadata md) {
23322332
!Status.Submitted.equals(md.getWorkflowStatus()))
23332333
return;
23342334

2335+
// get the SITE information
2336+
String siteCode = md.getSiteOwnershipCode();
2337+
Site site = SiteServices.findSiteBySiteCode(siteCode);
2338+
if (null == site) {
2339+
log.warn("Unable to locate SITE information for SITE CODE: " + siteCode);
2340+
return;
2341+
}
2342+
String lab = site.getLab();
2343+
lab = lab.isEmpty() ? siteCode : lab;
2344+
23352345
try {
23362346
email.setFrom(EMAIL_FROM);
23372347
email.setSubject("DOE CODE Record " + md.getWorkflowStatus().toString());
@@ -2343,6 +2353,8 @@ private static void sendStatusNotification(DOECodeMetadata md) {
23432353
msg.append("<html>");
23442354
msg.append("A new DOE CODE record has been ")
23452355
.append(md.getWorkflowStatus())
2356+
.append(" for ")
2357+
.append(lab)
23462358
.append(" and is awaiting approval:");
23472359

23482360
msg.append("<P>Code ID: ").append(md.getCodeId());

0 commit comments

Comments
 (0)