# Daily payment reminders for Payment Studio invoices.
#
# Only acts when Invoices ▸ Invoice settings ▸ Payment reminders is switched on
# (off by default) — the script exits immediately otherwise, so shipping this
# cron everywhere is harmless. When on, each OPEN invoice with a customer email
# is reminded before / on / after its due date as configured there, at most
# the configured number of times and never twice on one day. The PDF copy is
# attached when "Attach PDF" is on (rendered directly — cron isn't php-fpm).
#
# Runs as www-data because it writes the studio's own store under
# /var/www/alpha-private. Once a day, mid-morning server time.
#
# The guard keeps a partial install harmless: no panel, no run.
40 8 * * * www-data [ -f /var/www/alpha/bin/invoice-reminders.php ] && nice -n 10 /usr/bin/php /var/www/alpha/bin/invoice-reminders.php >/dev/null 2>&1
