Author Topic: Mail to list 1, but don't mail users that are on list 2  (Read 5325 times)

hilco

  • Posts: 11
    • View Profile
Mail to list 1, but don't mail users that are on list 2
« on: August 06, 2007, 04:13:57 pm »
list one has 1000 members,

list two has 52 members,

I want to mail list one, but don't want to bother the users that are also on list two. (They are on both lists) How to do that?

And if it's not possible, what I think is not at the moment, could you please integrate it, that would be great.

Maybe some sort of mail properties screen before really sending the mail.

Thanks!

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Mail to list 1, but don't mail users that are on list 2
« Reply #1 on: August 06, 2007, 08:30:37 pm »
Greetings,

Please check out the following post:

http://listmailpro.com/forum/index.php?topic=1440.0

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

hilco

  • Posts: 11
    • View Profile
Mail to list 1, but don't mail users that are on list 2
« Reply #2 on: October 04, 2007, 06:14:46 am »
you might just do this using two arrays.

Code: [Select]

$sql = "SELECT `email` FROM `lm_users` WHERE
`list` = ".$list1." AND
`cnf` != 2";

$result = $db->query($sql);

while($row = $result->fetch())
{
$list_1[] = $row[email];
}

$sql = "SELECT `email` FROM `lm_users` WHERE
`list` = ".$list2." AND
`cnf` != 2";

$result = $db->query($sql);

while($row = $result->fetch())
{
$list_2[] = $row[email];
}

// all doubles
$double = array_intersect($list_1, $list_2);
// alle uniques
$unique = array_diff($list_1, $list_2);


This way you are not dependent on the mysql feature. The classes are my classes so you won't need those, I guess you get the idea though.