some email functions didn't use myemail, but used sendmail directly. This is now fixed and all emails should have the same header and footer.
/* add standard header and footer */
$subject = "$EmailName".$subject;
/* add standard header and footer */
$subject = "$EmailName".$subject;
- /* standard greeting */
- $name = DB_get_name('userid',$uid);
- $header = "Hello $name\n\n";
-
- /* and standard goodbye */
$footer = "\nHave a nice day\n".
" your E-Doko service department\n\n".
"-- \n".
$footer = "\nHave a nice day\n".
" your E-Doko service department\n\n".
"-- \n".
'help: http://wiki.nubati.net/EmailDoko '.
'bugs: http://wiki.nubati.net/EmailDokoIssues';
'help: http://wiki.nubati.net/EmailDoko '.
'bugs: http://wiki.nubati.net/EmailDokoIssues';
- $To = DB_get_email('userid',$uid);
+ if(is_array($uid))
+ {
+ /* send email to more than one person */
+
+ $header = "Hello all\n\n";
+
+ foreach($uid as $user)
+ {
+ $all[] = DB_get_email('userid',$user);
+ }
+ $To = implode(",",$all);
+ }
+ else
+ {
+ /* standard greeting */
+ $name = DB_get_name('userid',$uid);
+ $header = "Hello $name\n\n";
+
+ $To = DB_get_email('userid',$uid);
+ }
sendmail($To,$subject,$header.$message.$footer);
}
sendmail($To,$subject,$header.$message.$footer);
}
$message .= "\nUse these links to have a look at game ".DB_format_gameid($gameid).": \n";
/* send out final email */
$message .= "\nUse these links to have a look at game ".DB_format_gameid($gameid).": \n";
/* send out final email */
foreach($userids as $user)
{
foreach($userids as $user)
{
- $all[] = DB_get_email('userid',$user);
-
/* add links for all players */
$hash = DB_get_hash_from_gameid_and_userid($gameid,$user);
$name = DB_get_name('userid',$user);
/* add links for all players */
$hash = DB_get_hash_from_gameid_and_userid($gameid,$user);
$name = DB_get_name('userid',$user);
$link = "$name: ".$HOST.$INDEX."?action=game&me=".$hash."\n" ;
$message .= $link;
}
$link = "$name: ".$HOST.$INDEX."?action=game&me=".$hash."\n" ;
$message .= $link;
}
- $To = implode(",",$all);
-
$message .= "\n\n (you can use reply all on this email to reach all the players.)\n";
$message .= "\n\n (you can use reply all on this email to reach all the players.)\n";
- $subject = $EmailName.' Game over (game '.DB_format_gameid($gameid).') ';
- sendmail($To,$subject,$message);
+ $subject = ' Game over (game '.DB_format_gameid($gameid).') ';
+ mymail($userids,$subject,$message);
DB_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idD', '".$randomNR[$i]."', 'false')");
/* send out email, TODO: check for error with email */
DB_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idD', '".$randomNR[$i]."', 'false')");
/* send out email, TODO: check for error with email */
- $message = "\n".
- "you are invited to play a game of DoKo.\n".
+ $message = "You are invited to play a game of DoKo.\n".
"Please, place comments and bug reports here:\n".
"http://wiki.nubati.net/index.php?title=EmailDoko\n\n".
"The whole round would consist of the following players:\n".
"Please, place comments and bug reports here:\n".
"http://wiki.nubati.net/index.php?title=EmailDoko\n\n".
"The whole round would consist of the following players:\n".
"".$HOST.$INDEX."?action=game&me=";
$subject = 'You are invited to a game of DoKo (game '.DB_format_gameid($gameid).')';
"".$HOST.$INDEX."?action=game&me=";
$subject = 'You are invited to a game of DoKo (game '.DB_format_gameid($gameid).')';
- sendmail($EmailA,$subject, "Hello $PlayerA,\n".$message.$hashA);
- sendmail($EmailB,$subject, "Hello $PlayerB,\n".$message.$hashB);
- sendmail($EmailC,$subject, "Hello $PlayerC,\n".$message.$hashC);
- sendmail($EmailD,$subject, "Hello $PlayerD,\n".$message.$hashD);
+ mymail($useridA,$subject, $message.$hashA);
+ mymail($useridB,$subject, $message.$hashB);
+ mymail($useridC,$subject, $message.$hashC);
+ mymail($useridD,$subject, $message.$hashD);
echo "<div class=\"message\">You started a new game. The emails have been sent out!</div>\n";
display_user_menu($myid);
echo "<div class=\"message\">You started a new game. The emails have been sent out!</div>\n";
display_user_menu($myid);
"to log into the server. The new password is valid for 24h, so make\n".
"sure you reset your password to something new. Your old password will\n".
"also still be valid until you set a new one.\n";
"to log into the server. The new password is valid for 24h, so make\n".
"sure you reset your password to something new. Your old password will\n".
"also still be valid until you set a new one.\n";
- $subject = $EmailName.' Recovery';
- sendmail($email,$subject,$message);
+ $subject = 'Recovery';
+ mymail($myid,$subject,$message);
/* we save these in the database */
DB_set_recovery_password($myid,md5($newpw));
/* we save these in the database */
DB_set_recovery_password($myid,md5($newpw));