plegall / Piwigo-photo_from_email

1 stars 5 forks source link

Notification Email is send to all users #3

Open jheinitz opened 7 years ago

jheinitz commented 7 years ago

Hello,

very cool plugin. I like it. But .... :-)

I configured a mailbox on my mailserver where I send emails containing a picture. I can see that the picture is displayed in the "Ausstehende Fotos" (Pending photos) tab. The big problem is that every user receives an email that a new photo was uploaded. Even when I add a Dummy group only containing myself, the mails are send to all users.

Could you please have a look?

Kind regards

Jens

Piwigo-Version Piwigo 2.8.6 Server-Umgebung Betriebssystem: Linux PHP: 7.0.13-0ubuntu0.16.04.1 (Info anzeigen) [2017-01-29 22:14:05] MySQL: 5.7.17-0ubuntu0.16.04.1 [2017-01-29 22:14:05] Grafikbibliothek: GD 2.1.1

jheinitz commented 7 years ago

Hello,

I think I found the reason. In functions_include.php is a query defined to retrieve the user groups for notifications. This is simply retreiving all existing groups:

SELECT id FROM piwigo_groups;

I think it should be like this:

SELECT id FROM piwigo_groups WHERE pfemail_notify = "true";

What do you think?

Kind regards

Jens

dartcafe commented 7 years ago

I tried your solution and it works for me. I made the changes in include/functions.inc.php. Thanks.

dartcafe commented 6 years ago

PR in #5