A task with its own `MAILTO` is now written in place, followed by a line resetting `MAILTO` to the global value, or to the `dokku` user when none is set, rather than grouped at the end of the crontab, so no other task is mailed to its recipient whatever order the tasks are written in.
19 lines
367 B
Cheetah
19 lines
367 B
Cheetah
{{ if .Mailfrom -}}
|
|
MAILFROM={{ .Mailfrom }}
|
|
{{ end -}}
|
|
{{ if .Mailto -}}
|
|
MAILTO={{ .Mailto }}
|
|
{{ end -}}
|
|
PATH=/usr/local/bin:/usr/bin:/bin
|
|
SHELL=/bin/bash
|
|
|
|
{{ range $task := .Tasks -}}
|
|
{{ if $task.Mailto -}}
|
|
MAILTO={{ $task.Mailto }}
|
|
{{ end -}}
|
|
{{ $task.Schedule }} {{ $task.DokkuRunCommand }}
|
|
{{ if $task.Mailto -}}
|
|
MAILTO={{ $.ResetMailto }}
|
|
{{ end -}}
|
|
{{ end -}}
|