From 9f845beffd0e3d54d3c0846d879c99f4a271b791 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 9 Sep 2016 11:01:37 +0200 Subject: [PATCH] when more then one users have the same email, only send the notification once --- notifyall/notifyall.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifyall/notifyall.php b/notifyall/notifyall.php index 2f47838f..3f2cdc89 100644 --- a/notifyall/notifyall.php +++ b/notifyall/notifyall.php @@ -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); -- 2.39.5