/** * bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) * * @param unknown_type $from * @param unknown_type $to * @param unknown_type $subject * @param unknown_type $message */ public static function sendEmail($from, $to, $subject, $message) { $eContacts = Api_Dao_UserProfile::getEContacts($to, $from); $toEmail = array(); $fromEmail = ""; foreach ($eContacts as $contact) { if ($contact->user_id == $from) { $fromEmail = $contact->contact_value; } else { $toEmail[] = $contact->contact_value; } } $headers = "From: {$fromEmail}\r\nReply-To: {$fromEmail}"; // FIXME: uncomment to actually send the email //return mail(implode(",", $toEmail), $subject, $message, $headers); }
/** * Returns a assocative array of profile values for the profile fields in $fieldNames. */ public function getProfileValues($fieldNames) { $dbUserProfile = new Api_Dao_UserProfile(); $dbUserProfile->setUserId($this->uid); $dbUserProfile->retrieveFromDb($fieldNames, $this->database); return $userProfile = $dbUserProfile->getUserProfile(); }