Browse Source

Email fixes.

Nathaniel van Diepen 11 years ago
parent
commit
7ef0881f5b
3 changed files with 17 additions and 5 deletions
  1. 1 1
      api.php
  2. 15 3
      data/emails/welcome.template
  3. 1 1
      php/emails.php

+ 1 - 1
api.php

@@ -79,7 +79,7 @@
 									if(addUser($_GET['username'],$_GET['password'],$_GET['email'])){
 										$key = login($_GET['username'],$_GET['password']);
 										$_SESSION['username'] = $_GET['username'];
-										sendMail('welcome',$_GET['email'],get('email'),Array($_GET['username'],$_GET['password'],get('email')));
+										sendMail('welcome','Welcome!',$_GET['email'],get('email'),Array($_GET['username'],$_GET['password'],get('email')));
 									}else{
 										$ret['error'] = "Could not add user. ".$mysqli->error;
 									}

+ 15 - 3
data/emails/welcome.template

@@ -1,3 +1,15 @@
-Welcome to bugs! Information for your account is as follows:
-Username: %s
-Password: %s
+<html>
+	<head>
+		<title>
+			Welcome!
+		</title>
+	</head>
+	<body>
+		<p>
+			Welcome to bugs! Information for your account is as follows:<br/>
+			Username: %s<br/>
+			Password: %s<br/>
+			If this is not your information please let the webmaster know at: %s
+		</p>
+	</body>
+</html>

+ 1 - 1
php/emails.php

@@ -3,7 +3,7 @@
 	require_once(PATH_PHP.'database.php');
 	require_once(PATH_PHP.'security.php');
 	require_once(PATH_PHP.'user.php');
-	function sendMail($template,$to=null,$from=null,$context=Array()){
+	function sendMail($template,$subject,$to=null,$from=null,$context=Array()){
 		if(is_null($to)){
 			$to = get('email');
 		}