Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added DCC data officer in c.c. for DCC projects oot notification #22

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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