Multiple birthday emails fixed by adding this at the top of trigger_birthday_notifications() in libs/triggers.inc.php (right after globals):
Cause of multiples:
The forum index page calls the birthday function every time it loads. On a busy day many users (and bots) visit the index → the function runs many times → each run tries to send emails to everyone whose birthday is today.
PHP// Skip if already sent today
$query = "SELECT CACHE_VALUE FROM {$config['TABLE_PREFIX']}CACHE WHERE CACHE_FIELD = 'birthdays'";
$sth = $dbh->do_query($query, __LINE__, __FILE__);
list($sent_today) = $dbh->fetch_array($sth) ?: [''];
if ($sent_today === $today) {
return;
}Why the fix stops duplicates:
The added check looks at the CACHE 'birthdays' value before doing anything.
If it already matches today’s date, the function stops immediately.
The first run of the day sends one email to each user who has a birthday today and then sets the CACHE value. All later runs see the updated value and skip the whole process.
This way every qualifying user gets exactly one email, and no duplicates are sent.
Backup your files first. Test with page reloads.
Kept "Send birthday email" disabled until patched, because until it's patched, multiple emails will be sent.