I don't get it.
Here is the code from the mailer:
$sth = $sub->prepare ("SELECT * FROM Links WHERE ReceiveMail = 'Yes'");
}
else {
$ids = join ",", $in->param('mail');
$ids or print "No users were selected!" and exit;
$sth = $sub->prepare ("SELECT * FROM Links WHERE ID IN ($ids) AND ReceiveMail = 'Yes'");
}
$sth->execute();
while ($link = $sth->fetchrow_hashref) {
($id, $name, $email) = ($link->{'ID'}, $link->{'Contact_Name'}, $link->{'Contact_Email'});
The values for the ID, $name and $email are taken from the same "link" so you can't get it mixed up.
Here's a subset of the mailing:
380 - Message would have been sent to 'Ira@postcards.com'
381 - Already mailed to: 'Ira@postcards.com'!
382 - Already mailed to: 'Ira@postcards.com'!
383 - Invalid email address: . Skipping.
384 - Invalid email address: . Skipping.
385 - Invalid email address: . Skipping.
386 - Invalid email address: . Skipping.
387 - Invalid email address: . Skipping.
388 - Invalid email address: . Skipping.
389 - Already mailed to: 'Ira@postcards.com'!
390 - Already mailed to: 'Ira@postcards.com'!
391 - Already mailed to: 'Ira@postcards.com'!
392 - Already mailed to: 'Ira@postcards.com'!
393 - Already mailed to: 'Ira@postcards.com'!
394 - Message would have been sent to 'ira@postcards.com'
395 - Already mailed to: 'ira@postcards.com'!
396 - Already mailed to: 'ira@postcards.com'!
397 - Already mailed to: 'ira@postcards.com'!
398 - Already mailed to: 'Ira@postcards.com'!
399 - Already mailed to: 'Ira@postcards.com'!
400 - Already mailed to: 'Ira@postcards.com'!
401 - Already mailed to: 'Ira@postcards.com'!
402 - Already mailed to: 'Ira@postcards.com'!
403 - Already mailed to: 'Ira@postcards.com'!
404 - Already mailed to: 'Ira@postcards.com'!
405 - Already mailed to: 'Ira@postcards.com'!
406 - Already mailed to: 'Ira@postcards.com'!
407 - Already mailed to: 'Ira@postcards.com'!
In that case, the _only_ link he'd be notified of is the very first one - 380.
This should really be a bit smarter and put all the links for that person together, and send one letter with all the values, but it doesn't.
Note-- the case "Ira" and "ira" generate two different mailings.
To correct for that, everything should be lowercased before tallying the names.
Here is the code from the mailer:
Code:
if ($in->param('all')) { $sth = $sub->prepare ("SELECT * FROM Links WHERE ReceiveMail = 'Yes'");
}
else {
$ids = join ",", $in->param('mail');
$ids or print "No users were selected!" and exit;
$sth = $sub->prepare ("SELECT * FROM Links WHERE ID IN ($ids) AND ReceiveMail = 'Yes'");
}
$sth->execute();
while ($link = $sth->fetchrow_hashref) {
($id, $name, $email) = ($link->{'ID'}, $link->{'Contact_Name'}, $link->{'Contact_Email'});
The values for the ID, $name and $email are taken from the same "link" so you can't get it mixed up.
Here's a subset of the mailing:
Code:
379 - Invalid email address: . Skipping. 380 - Message would have been sent to 'Ira@postcards.com'
381 - Already mailed to: 'Ira@postcards.com'!
382 - Already mailed to: 'Ira@postcards.com'!
383 - Invalid email address: . Skipping.
384 - Invalid email address: . Skipping.
385 - Invalid email address: . Skipping.
386 - Invalid email address: . Skipping.
387 - Invalid email address: . Skipping.
388 - Invalid email address: . Skipping.
389 - Already mailed to: 'Ira@postcards.com'!
390 - Already mailed to: 'Ira@postcards.com'!
391 - Already mailed to: 'Ira@postcards.com'!
392 - Already mailed to: 'Ira@postcards.com'!
393 - Already mailed to: 'Ira@postcards.com'!
394 - Message would have been sent to 'ira@postcards.com'
395 - Already mailed to: 'ira@postcards.com'!
396 - Already mailed to: 'ira@postcards.com'!
397 - Already mailed to: 'ira@postcards.com'!
398 - Already mailed to: 'Ira@postcards.com'!
399 - Already mailed to: 'Ira@postcards.com'!
400 - Already mailed to: 'Ira@postcards.com'!
401 - Already mailed to: 'Ira@postcards.com'!
402 - Already mailed to: 'Ira@postcards.com'!
403 - Already mailed to: 'Ira@postcards.com'!
404 - Already mailed to: 'Ira@postcards.com'!
405 - Already mailed to: 'Ira@postcards.com'!
406 - Already mailed to: 'Ira@postcards.com'!
407 - Already mailed to: 'Ira@postcards.com'!
In that case, the _only_ link he'd be notified of is the very first one - 380.
This should really be a bit smarter and put all the links for that person together, and send one letter with all the values, but it doesn't.
Note-- the case "Ira" and "ira" generate two different mailings.
To correct for that, everything should be lowercased before tallying the names.