phppickem
phppickem copied to clipboard
Not all emails are working.
I can succesfully send emails using the "last weeks results/reminder" email template, but if I try to send an email using the "Weekly picks Reminder" template, it never sends any emails. This has worked for many seasons, but for some reason doesn't work in the current version.
it looks like a problem with the SQL
due to a recent update to MySQL, the ONLY_FULL_GROUP_BY setting was added to sql_mode which causes the specialized query for cannedMsg == WEEKLY_PICKS_REMINDER to error
this can be confirmed by removing the ONLY_FULL_GROUP_BY setting from sql_mode by:
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
and set permanently in the my.cnf file but I didn't want to alter the default settings so to meet the requirements of this new setting I added the u.userID to the group by clause in send_email.php:
# diff send_email.php send_email.php.bak
116,117c116
< // $sql .= "group by u.firstname, u.email ";
< $sql .= "group by u.userID, u.firstname, u.email ";
---
> $sql .= "group by u.firstname, u.email ";