summaryrefslogtreecommitdiffstats
path: root/include/functions.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2009-04-29 21:34:16 -0700
committerArun Persaud <arun@nubati.net>2009-04-29 21:34:16 -0700
commit03d6cd5ba13a0aac918734c1f797df4f149d9194 (patch)
tree852592c3d2f189d283cb1106bc4e4f67949a05e7 /include/functions.php
parent26bcd1e5b01ca8575b513e12ce7bdd302614273c (diff)
downloade-DoKo-03d6cd5ba13a0aac918734c1f797df4f149d9194.tar.gz
e-DoKo-03d6cd5ba13a0aac918734c1f797df4f149d9194.tar.bz2
e-DoKo-03d6cd5ba13a0aac918734c1f797df4f149d9194.zip
CLEANUP: all email now uses the standard header and footer
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.
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/include/functions.php b/include/functions.php
index 7bdfd31..e57c2e5 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -72,11 +72,7 @@ function mymail($uid,$subject,$message)
/* add standard header and footer */
$subject = "$EmailName".$subject;
- /* standard greeting */
- $name = DB_get_name('userid',$uid);
- $header = "Hello $name\n\n";
-
- /* and standard goodbye */
+ /* standard goodbye */
$footer = "\nHave a nice day\n".
" your E-Doko service department\n\n".
"-- \n".
@@ -85,7 +81,26 @@ function mymail($uid,$subject,$message)
'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);
}