Skip to content

Commit

Permalink
added DCC data officer in c.c. for DCC projects oot notification
Browse files Browse the repository at this point in the history
  • Loading branch information
hurngchunlee committed Aug 30, 2024
1 parent 85480f5 commit 0b3f3d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion project/internal/cmd/pdbutil/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "[email protected]")
}

for _, u := range recipients {

// only apply `alertSkipPI` option if
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 0b3f3d0

Please sign in to comment.