Separate emailing into its own function.
authorJonas Häggqvist <rasher@rasher.dk>
Tue, 17 Mar 2009 21:47:58 +0000 (17 22:47 +0100)
committerJonas Häggqvist <rasher@rasher.dk>
Tue, 17 Mar 2009 21:47:58 +0000 (17 22:47 +0100)
private/themesite.class.php

index b3be852..1f5be13 100644 (file)
@@ -238,6 +238,12 @@ class themesite {
         }
     }
 
+    private function send_mail($subject, $to, $msg) {
+        $msg = wordwrap($msg, 78);
+        $headers = 'From: themes@rockbox.org';
+        mail($to, $subject, $msg, $headers);
+    }
+
     public function validatetheme($zipfile) {
         $err = array();
         return $err;
@@ -264,11 +270,9 @@ Thank for your contributions
 The Rockbox Theme Site team.
 END;
         /* ' (this is here to keep my syntax hilighting happy) */
-        $msg = wordwrap($msg, 78);
         $subject = "Rockbox Theme Site email verification";
         $to = sprintf("%s <%s>", $author, $email);
-        $headers = 'From: themes@rockbox.org';
-        mail($to, $subject, $msg, $headers);
+        $this->send_mail($subject, $to, $msg);
     }
 
     public function verifyemail($token) {