#!/usr/bin/env php get(BugRepository::class)->findAllAssigned() as $assigned => $binfos) { $mbody = format_email_body($binfos); $email_user = $assigned . '@php.net'; mail($email_user, 'Assigned PHP bugs reminder', $mbody, 'From: php-bugs@lists.php.net', '-fphp-bugs@lists.php.net'); } function format_email_body($binfos) { $links = ''; $count = count($binfos); $earliest_changed = time(); $earliest_opened = time(); foreach ($binfos as $binfo) { if ($earliest_changed > $binfo['ts_changed']) { $earliest_changed = $binfo['ts_changed']; } if ($earliest_opened > $binfo['ts_opened']) { $earliest_opened = $binfo['ts_opened']; } $link_title = strlen($binfo['sdesc']) < 65 ? $binfo['sdesc'] : substr($binfo['sdesc'], 0, 65) . '...'; $links .= " Title: $link_title\r\n"; $links .= " Type: {$binfo['bug_type']} with Status: {$binfo['status']}\r\n"; $links .= " Link: https://bugs.php.net/{$binfo['id']}\r\n\r\n"; } $assigned = $binfo['assign']; $salute = ($count === 1) ? 'one bug report' : "$count bug reports"; $date_c = date('M d, Y', $earliest_changed); $date_o = date('M d, Y', $earliest_opened); $body = <<