From 4b1ab7a70823eb5ed168e566b9c7fc10eab6a88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=A4nzer?= Date: Wed, 23 Nov 2011 22:25:49 +0100 Subject: bug 827: Subject changed to the one in the wiki, count the mails sent so far and add comma after "Hello X Y" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Tänzer --- scripts/send_thawte.php.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/send_thawte.php.txt b/scripts/send_thawte.php.txt index f02b73c..d3a9e77 100644 --- a/scripts/send_thawte.php.txt +++ b/scripts/send_thawte.php.txt @@ -112,18 +112,19 @@ $lastid = trim(fgets($fp, 4096)); fclose($fp); } - - $subject = "Change in points calculation"; echo "ID now: $lastid\n"; + + $count = 0; + $query = "select `id`,`fname`,`lname`,`email`,`language` from `users` where `deleted` = 0 and `id` > '$lastid' order by `id`"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { - $mailtxt = "Hello ".$row["fname"]." ".$row["lname"]."\n".$lines_EN."\n\n"; + $mailtxt = "Hello ${row["fname"]} ${row["lname"]},\n".$lines_EN."\n\n"; switch ($row["language"]) { case "de_DE": @@ -152,13 +153,14 @@ break; } - sendmail($row['email'], "[CAcert.org] $subject", $mailtxt, "mailing@cacert.org", "", "", "CAcert", "returns@cacert.org", ""); + sendmail($row['email'], "[CAcert.org] Changes at CAcert", $mailtxt, "mailing@cacert.org", "", "", "CAcert", "returns@cacert.org", ""); $fp = fopen("send_thawte_lastid.txt", "w"); fputs($fp, $row["id"]."\n"); fclose($fp); - echo "Sent mail to: ".$row["id"]."\n"; + $count++; + echo "Sent ${count}th mail. User ID: ${row["id"]}\n"; sleep (1); } -- cgit v1.2.1