Skip to content

Commit

Permalink
Add a timestamp to PeriodicSubjectFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Oct 2, 2024
1 parent 35558a7 commit ff72f22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func SendPeriodicNotification(ctx context.Context, j *Job) error {
return err
}

subject := PeriodicSubjectFormat // this is a static/generic string
subject := fmt.Sprintf(PeriodicSubjectFormat, time.Now().Format("2006-01-02 15:04")) // Mostly static with a timestamp to distinguish

msg := fmt.Sprintf(
PeriodicMessageFormat,
Expand Down
4 changes: 2 additions & 2 deletions notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const PeriodicMessageFormat = `Analysis "%s" has been running for %s and will st

// PeriodicSubjectFormat is the subject for the email that is sent
// to users as a regular reminder of a running job
// no parameters, as it is vague on purpose to encourage opening the email with full details
const PeriodicSubjectFormat = `CyVerse: Your analysis is still running`
// one parameter should be a timestamp, to distinguish messages so they're not grouped by gmail et al
const PeriodicSubjectFormat = `CyVerse: Your analysis is still running (%s)`

// Notification is a message intended as a notification to some upstream service
// or the DE UI.
Expand Down

0 comments on commit ff72f22

Please sign in to comment.