From a486e2f91f4f11079b320e3634ef6f1d9bfd4490 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 30 Aug 2022 08:32:12 +0200 Subject: [PATCH] Update thirdparties.modules.php --- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 008888832cd..1d7acf02c09 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -226,7 +226,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; + $sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")"; // La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients return parent::getNbOfRecipients($sql); }