diff --git a/scripts/pending-payments-watchdog b/scripts/pending-payments-watchdog new file mode 100644 index 00000000..600d46da --- /dev/null +++ b/scripts/pending-payments-watchdog @@ -0,0 +1,22 @@ +#!/usr/bin/php + + +require_once('/standardebooks.org/web/lib/Core.php'); + +$pendingPayments = Db::Query(' + SELECT * + from PendingPayments + where ProcessedOn is not null + '); + +if(sizeof($pendingPayments) > 0){ + $em = new Email(); + $em->To = ADMIN_EMAIL_ADDRESS; + $em->From = ADMIN_EMAIL_ADDRESS; + $em->Subject = 'Unprocessed payment in database'; + $em->Body = Template::EmailAdminUnprocessedDonations(); + $em->TextBody = Template::EmailAdminUnprocessedDonationsText(); + $em->Send(); +} + +?> diff --git a/templates/EmailAdminUnprocessedDonations.php b/templates/EmailAdminUnprocessedDonations.php new file mode 100644 index 00000000..82607821 --- /dev/null +++ b/templates/EmailAdminUnprocessedDonations.php @@ -0,0 +1,9 @@ + + +
+There are unprocessed donations in the database.
+ + diff --git a/templates/EmailAdminUnprocessedDonationsText.php b/templates/EmailAdminUnprocessedDonationsText.php new file mode 100644 index 00000000..0ae7399f --- /dev/null +++ b/templates/EmailAdminUnprocessedDonationsText.php @@ -0,0 +1 @@ +There are unprocessed donations in the database.