From 0b3f3d0785b834950cee03da5fbe5a752e2cbd55 Mon Sep 17 00:00:00 2001 From: Hurng-Chun Lee Date: Fri, 30 Aug 2024 14:07:17 +0200 Subject: [PATCH] added DCC data officer in c.c. for DCC projects oot notification --- project/internal/cmd/pdbutil/project.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/project/internal/cmd/pdbutil/project.go b/project/internal/cmd/pdbutil/project.go index 591d4ee..8650964 100644 --- a/project/internal/cmd/pdbutil/project.go +++ b/project/internal/cmd/pdbutil/project.go @@ -804,6 +804,13 @@ func ootAlert(ipdb pdb.PDB, prj *pdb.Project, info *pdb.DataProjectInfo, lastAle SenderName: alertSender, } + // add condituional carbon-copies for every email send to a recipient + cclist := []string{alertCarbonCopy} + + if strings.HasPrefix(info.ProjectID, "24") { + cclist = append(cclist, "DCC-DataOfficer@donders.ru.nl") + } + for _, u := range recipients { // only apply `alertSkipPI` option if @@ -843,7 +850,7 @@ func ootAlert(ipdb pdb.PDB, prj *pdb.Project, info *pdb.DataProjectInfo, lastAle if alertDryrun { log.Infof("[%s] alert %s", info.ProjectID, u.Email) - } else if err := m.SendMail(alertSenderEmail, subject, body, []string{u.Email}, alertCarbonCopy); err != nil { + } else if err := m.SendMail(alertSenderEmail, subject, body, []string{u.Email}, cclist...); err != nil { log.Errorf("[%s] fail to sent oot alert to %s: %s", info.ProjectID, u.Email, err) }