]> git.mxchange.org Git - friendica-addons.git/commitdiff
when more then one users have the same email, only send the notification once
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Fri, 9 Sep 2016 09:01:37 +0000 (11:01 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Fri, 9 Sep 2016 09:01:37 +0000 (11:01 +0200)
notifyall/notifyall.php

index 2f47838f78fad90fdd21da248a307f3aac5d5943..3f2cdc890ab0fa6f565a587996f026d7c9d934ea 100644 (file)
@@ -63,7 +63,7 @@ function notifyall_post(&$a) {
        }
        $sql_extra = ((intval($_REQUEST['test'])) ? sprintf(" AND `email` in ( %s )", $email) : '');
 
-       $recips = q("SELECT `email` FROM `user` WHERE `verified` AND NOT `account_removed` AND NOT `account_expired` $sql_extra");
+       $recips = q("SELECT DISTINCT `email` FROM `user` WHERE `verified` AND NOT `account_removed` AND NOT `account_expired` $sql_extra");
 
        if(! $recips) {
                notice( t('No recipients found.') . EOL);