phppickem icon indicating copy to clipboard operation
phppickem copied to clipboard

Not all emails are working.

Open skd5aner opened this issue 8 years ago • 2 comments

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.

skd5aner avatar Sep 21 '16 20:09 skd5aner

it looks like a problem with the SQL

DonThorntonJr avatar Sep 22 '16 21:09 DonThorntonJr

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 ";

DonThorntonJr avatar Sep 22 '16 22:09 DonThorntonJr