{{define "delivery_attempts"}} {{if .AttemptsOmitted}}

{{.AttemptsOmitted}} attempt{{if ne .AttemptsOmitted 1}}s{{end}} omitted between the first and last shown.

{{end}} {{range .Results}} {{/* Inside this loop, dot is one attempt and $ the whole delivery. */}}
Attempt {{.AttemptNum}} {{if not .Success}}failure{{else if eq $.Target.Type "database"}}archived{{else if eq $.Target.Type "log"}}written to the log{{else}}success{{end}} {{/* A database or log target sends no HTTP request, so its attempts have no status code. */}} {{if not (eq $.Target.Type "database" "log")}} Status: {{if .HasStatusCode}}{{.StatusCode}}{{else}}— (no response){{end}} {{end}} Duration: {{.DurationMS}} ms
{{if .Error}}

Error: {{.Error}}

{{end}} {{if .ResponseBody}}
{{.ResponseBody}}
{{end}} {{if .ResponseTruncated}} {{if .ResponseSizeKnown}}

Response truncated for display: showing {{.ResponseShownBytes}} of {{.ResponseBytes}} bytes.

{{else}}

Showing {{.ResponseShownBytes}} of the {{.ResponseBytes}} recorded bytes. The response reached the recording limit, so the remote may have sent more that was never stored.

{{end}} {{end}}
{{else}}

No attempts recorded yet.

{{end}} {{end}}