diff --git a/formatMessage.go b/formatMessage.go index 456d5d5..ea678dd 100644 --- a/formatMessage.go +++ b/formatMessage.go @@ -83,6 +83,7 @@ func FormatMessage(ctx context.Context, emailReq EmailRequest, payload map[strin payload["DEToolsLink"] = deSettings.base + deSettings.tools payload["DECollectionsLink"] = deSettings.base + deSettings.collections payload["DEAppsLink"] = deSettings.base + deSettings.apps + payload["DEAnalysesLink"] = deSettings.base + deSettings.analyses payload["DEPublicationRequestsLink"] = deSettings.base + deSettings.admin + deSettings.apps payload["DEPidRequestLink"] = deSettings.base + deSettings.admin + deSettings.doi @@ -105,7 +106,7 @@ func FormatMessage(ctx context.Context, emailReq EmailRequest, payload map[strin switch emailReq.Template { case "analysis_status_change", "analysis_periodic_notification": - var startDateText, resultFolderPath string + var startDateText, resultFolderPath, analysisId string // Format the analysis start date. err = ExtractDetails(payload, &startDateText, "startdate") @@ -127,6 +128,13 @@ func FormatMessage(ctx context.Context, emailReq EmailRequest, payload map[strin } payload["DEOutputFolderLink"] = deSettings.base + deSettings.data + resultFolderPath + // Format the link to the analysis details page + err = ExtractDetails(payload, &analysisId, "analysisid") + if err != nil { + log.Errorf("unable to extract the analysis ID: %s", err) + } + payload["DEAnalysisDetailsLink"] = deSettings.base + deSettings.analyses + "/" + analysisId + case "added_to_team": var teamName string err = ExtractDetails(payload, &teamName, "team_name") diff --git a/templates/html/analysis_periodic_notification.tmpl b/templates/html/analysis_periodic_notification.tmpl index 141265e..fffdc8f 100644 --- a/templates/html/analysis_periodic_notification.tmpl +++ b/templates/html/analysis_periodic_notification.tmpl @@ -3,6 +3,7 @@
The analysis {{.analysisname}} is still running and has been running for {{.runduration}}{{ if .endduration }}, and will stop in {{.endduration}}{{ end }}. This is an auto-scheduled courtesy reminder to help you manage your compute quota.
Analysis launch date: {{.startdate}}
+Terminate or extend your time limit: {{if .DEAnalysisDetailsLink}}{{.DEAnalysisDetailsLink}}{{ else }}{{ .DEAnalysesLink }}{{ end }}
{{if .access_url}}Access your VICE analysis: {{.access_url}}
{{- end}} {{ if or (eq .analysisstatus "Completed") (eq .analysisstatus "Failed")}}Results folder: {{.analysisresultsfolder}}
{{- end}} diff --git a/templates/html/analysis_status_change.tmpl b/templates/html/analysis_status_change.tmpl index 26123e7..2612f06 100644 --- a/templates/html/analysis_status_change.tmpl +++ b/templates/html/analysis_status_change.tmpl @@ -6,7 +6,8 @@ {{.analysisdescription}}Analysis launch date: {{.startdate}}
+{{if .DEAnalysisDetailsLink}}Analysis Details: {{.DEAnalysisDetailsLink}}
{{- end}} {{if .access_url}}Access your VICE analysis: {{.access_url}}
{{- end}} {{ if or (eq .analysisstatus "Completed") (eq .analysisstatus "Failed")}}Results folder: {{.analysisresultsfolder}}
{{- end}} -{{ template "footer" . }} \ No newline at end of file +{{ template "footer" . }}