function process($data) { require_once PATH_CORE . '/classes/contactEmails.class.php'; $cet = new ContactEmailTable($this->db); require_once PATH_CORE . '/classes/user.class.php'; $userInfoTable = new UserInfoTable($this->db); $userInfo = $userInfoTable->getRowObject(); $contactObj = $cet->getRowObject(); $contactObj->email = $data['email']; $contactObj->subject = $data['subject']; $contactObj->message = $data['message']; $contactObj->userid = $data['userid']; $contactObj->date = date("Y-m-d H:i:s", time()); $contactObj->topic = $data['topic']; $contactObj->insert(); // Submit email to lighthouse app $userInfo->load($contactObj->userid); $lhemail = '*****@*****.**'; $message = 'From: ' . $contactObj->email . "\n\n"; $message .= 'User ID: ' . $contactObj->userid . "\n\n"; $message .= 'Facebook profile: <a target="_blank" href="http://www.facebook.com/profile.php?id=' . $userInfo->fbId . '">http://www.facebook.com/profile.php?id=' . $userInfo->fbId . '</a>' . "\n\n"; $message .= 'Subject: ' . $contactObj->subject . "\n\n"; $message .= 'Topic: ' . $contactObj->topic . "\n\n"; $message .= "\n\n\n\nMessage:\n\n" . $contactObj->message; mail($lhemail, $contactObj->subject, $message, 'From: support@newscloud.com' . "\r\n"); $msg = 'Successfully submitted your comment. We will review this as soon as possible.'; $this->page->app->facebook->redirect(URL_CANVAS . '?p=home&msgType=success&msgTitle=' . urlencode('Success!') . '&msg=' . urlencode($msg)); //return '<p>Successfully submitted your comment. We will review this as soon as possible.</p>'; }
function sendContactEmail($userid, $prizeid, $subject, $message) { ///////////////////////////// // send a contact email to us for reference even if we dont email the user right away require_once PATH_CORE . '/classes/contactEmails.class.php'; $cet = new ContactEmailTable($log->db); $contactObj = $cet->getRowObject(); $contactObj->email = '*****@*****.**'; $contactObj->subject = 'Prize Award Link -' . $userid . '-' . $prizeid; $contactObj->message = mysql_real_escape_string($message); $contactObj->userid = $userid; $contactObj->date = date("Y-m-d H:i:s", time()); $contactObj->topic = 'team'; //echo '<pre>'.print_r($contactObj,true).'</pre>'; //echo 'Insert result: '. $contactObj->insert(); }