function sendNotification($notification, $end, $lastday) { $text = getMessageText($notification->how, $notification->what, $notification->when, $end); switch ($notification->how) { case 'mail': if (!isset($notification->target) || empty($notification->target)) { writeLog("Cannot send mail. Target ist missing."); break; } mail($notification->target, "Bald ist Ende", $text); writeLog("Mail sent to '" . $notification->target . "'"); break; case 'sms': break; case 'iphone': break; default: writeLog("Found unsupported notification type '" . $notification->how . "'. Exiting..."); return; } }
function createMessage($alias, $version) { return getMessageText($alias, $version); }