From dc34270ba46d54c9caf564aca2aa4fefebfe181e Mon Sep 17 00:00:00 2001 From: Nils <> Date: Sun, 27 Apr 2025 17:17:54 +0200 Subject: [PATCH] personal reminder script --- second_wednesday.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 second_wednesday.php diff --git a/second_wednesday.php b/second_wednesday.php new file mode 100644 index 0000000..2e1b211 --- /dev/null +++ b/second_wednesday.php @@ -0,0 +1,32 @@ +format('n'); + $year = $today->format('Y'); + + // Find the second Wednesday + $secondWednesday = new DateTime("second Wednesday of $year-$month", $timezone); + + return $today->format('Y-m-d') === $secondWednesday->format('Y-m-d'); +} + +if (isSecondWednesday()) { + // Configure your email details + $to = "nils@hilbricht.net"; + $subject = "Erinnerung: OSAMC Einladung schreiben"; + $message = "Nächste Woche ist OSAMC, bitte einladen."; + $headers = "From: nils@hilbricht.net\r\n"; // You might need a valid domain email + + // Send the email + mail($to, $subject, $message, $headers); +} + +// If you want output when running manually: +if (__FILE__ == realpath($_SERVER['SCRIPT_FILENAME'])) { + echo isSecondWednesday() ? "Email sent (or would have been sent) today.\n" : "Today is not the second Wednesday.\n"; +} +?>