xref: /web-master/scripts/event-weekly-email (revision 57dfe866)
1<?php
2/*
3	This checks for unapproved events, and emails php-webmaster@ if they exist.
4	It should be checked weekly (via cron).
5*/
6require dirname(dirname(__FILE__)).'/include/functions.inc';
7
8db_connect();
9
10$query = 'SELECT COUNT(*) FROM phpcal WHERE NOT approved';
11$count = db_get_one($query);
12
13if ($count > 0) {
14
15	$subject = "Pending unapproved events notice";
16	$message = "
17Greetings PHP Webmasters;
18
19There are roughly [$count] unapproved events awaiting moderation.  Please check the queue:
20
21	https://master.php.net/manage/event.php?unapproved=1
22
23Thanks!";
24
25	$headers = "From: php-webmaster@lists.php.net";
26
27	mail('php-webmaster@lists.php.net', $subject, $message, $headers, "-fnoreply@php.net");
28
29}
30