-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsignup.php
More file actions
34 lines (27 loc) · 692 Bytes
/
signup.php
File metadata and controls
34 lines (27 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
header("Content-Type: text/plain");
if(!isset($_POST['email'])) {
http_response_code(400);
print("Missing signup email");
return;
}
$email = $_POST['email'];
if(!strpos($email, '@')) {
http_response_code(400);
print("$email does not look like email address.");
return;
}
$subject = "$email signed up for Working Copy";
$body = "$email\n\nhas signed up for Working Copy";
if(isset($_POST['subject'])) {
$body .= "\nSubject: " . $_POST['subject'];
}
// send email
$ok = mail("working-copy-signup@appliedphasor.com", $subject, $body);
if($ok) {
print("OK\n");
} else {
http_response_code(400);
print("Unable to deliver signup email.\n");
}
?>