Skip to content

Commit

Permalink
Merge pull request #22 from dccn-tg/notify-dcc-data-officer
Browse files Browse the repository at this point in the history
added DCC data officer in c.c. for DCC projects oot notification
  • Loading branch information
hurngchunlee authored Sep 10, 2024
2 parents 85480f5 + 0b3f3d0 commit 00165cb
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 00165cb

Please sign in to comment.