Beispiel #1
0
 function password_reset_message($account)
 {
     $message = new AMPSystem_IntroText(AMP_dbcon(), AMP_CONTENT_PUBLICPAGE_ID_PASSWORD_RESET_EMAIL);
     return $message->mergeBodyFields(array('reset_link' => $this->password_reset_link($account)));
 }
Beispiel #2
0
 function save($data)
 {
     $options = $this->getOptions();
     if (!isset($this->udm->uid)) {
         $this->udm->errorMessage("Invalid Contact Info");
         return false;
     }
     if (!(isset($data['action_id']) && $data['action_id'])) {
         $this->udm->errorMessage("No Appointment Selected");
         return;
     }
     $schedule = new Schedule($this->dbcon, $options['schedule_id']);
     if (!$schedule->makeAppointment($this->udm->uid, $data['action_id'])) {
         $this->udm->errorMessage("The requested schedule time is not avaiable");
         return false;
     }
     $item =& $schedule->getScheduleItem($data['action_id']);
     $appt_contact_data = $this->udm->getData();
     $recipients = array();
     if (isset($options['email_contact_schedule']) && $options['email_contact_schedule']) {
         $recipients['schedule'] = $item->getOwnerEmail();
     }
     if (isset($options['email_contact_appointment']) && $options['email_contact_appointment']) {
         $recipients['appointment'] = $appt_contact_data['Email'];
     }
     if (empty($recipients)) {
         return true;
     }
     $item_data = $item->getData();
     $item_data['schedule_contact_name'] = $item->getOwnerName();
     $item_data['schedule_contact_email'] = $item->getOwnerEmail();
     $item_data['schedule_start_time_text'] = $item->getTimeText();
     $item_data = array_merge($item_data, $this->getAppointmentContactData());
     foreach ($recipients as $which_contact => $email) {
         $text_id = $options['email_contact_' . $which_contact];
         $text = new AMPSystem_IntroText($this->dbcon, $text_id);
         $sch_email = new AMPSystem_Email();
         $sch_email->setSubject($text->getTitle());
         $sch_email->setRecipient($email);
         $sch_email->setMessage($text->mergeBodyFields($item_data));
         if (!$sch_email->execute()) {
             trigger_error(sprintf(AMP_ERROR_SCHEDULE_APPOINTMENT_EMAIL_NOT_SENT, $email));
         }
     }
     return true;
 }
Beispiel #3
0
 function _readIntroText($id, $merge_fields = false)
 {
     $system_texts = AMPSystem_Lookup::instance('introTexts');
     if (!isset($system_texts[$id])) {
         return $id;
     }
     $textdata = new AMPSystem_IntroText($this->dbcon, $id);
     if ($textdata->isHtml()) {
         $this->containsHTML(true);
     }
     if ($merge_fields) {
         $merged_text = $textdata->mergeBodyFields($merge_fields);
     } else {
         $merged_text = $textdata->getBody();
     }
     return AMPDisplay_HTML::_activateIncludes($merged_text) . "\n\n";
 }