-
Notifications
You must be signed in to change notification settings - Fork 1
/
handle-contactus.php
33 lines (24 loc) · 953 Bytes
/
handle-contactus.php
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
<?php
try {
require_once('Sprinkles.php');
$sprink = new Sprinkles();
$from = request_param('email');
$from = preg_replace('/\n.*$/', ' ', $from); # Sanitizes $from; it'll go verbatim in the SMTP headers
$message = request_param('name') .
' reported a problem in the Get Satisfaction Instant On Help Center at ' .
date('H:i:s T, Y/m/d') . '.' . "\n\n" .
'Summary: ' . request_param('summary') . "\n\n" .
'Details: ' . request_param('observed') . "\n\n" .
'I\'m ' . request_param('feeling');
$subject = request_param('summary');
$contact = $sprink->site_contact_info();
$to = $contact['contact_email'];
mail($to, $subject, $message, "From: $from");
$name = request_param('name');
redirect('contactus-success.php?name=' . urlencode($name));
exit(0);
} catch (Exception $e) {
error_log("Exception thrown while preparing page: " . $e->getMessage());
$smarty->display('error.t');
}
?>