bug 827: Subject changed to the one in the wiki, count the mails sent so far
authorMichael Tänzer <neo@nhng.de>
Wed, 23 Nov 2011 21:25:49 +0000 (22:25 +0100)
committerMichael Tänzer <neo@nhng.de>
Wed, 23 Nov 2011 21:25:49 +0000 (22:25 +0100)
and add comma after "Hello X Y"

Signed-off-by: Michael Tänzer <neo@nhng.de>
scripts/send_thawte.php.txt

index f02b73c..d3a9e77 100644 (file)
                $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":
                                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);
        }