Example #1
0
 public function sendmailmessageAction()
 {
     $this->disableLayout();
     if ($this->getParam('sendmail') == "send") {
         $resaid = $this->getParam('resaid');
         $reservation = Object\Reservation::getById($resaid, 1);
         if ($reservation instanceof Object\Reservation) {
             $locationname = $reservation->getLocation()->getName();
             $resa = $reservation->getId();
             $email = $reservation->getGuest()->getEmail();
             $guestname = $reservation->getGuest()->getLastname();
             $parameters = array('location' => $locationname, 'bookingref' => $resa, 'message' => $this->getParam('message'), 'guestname' => $guestname);
             $mail = new Pimcore_Mail();
             $subject = 'Message ResaExpress - ' . $locationname;
             $mail->setParams($parameters);
             $mail->setReplyTo('*****@*****.**');
             $mail->setSubject($subject);
             $mail->setDocument('/fr/booking/standardmail');
             // $mail->setBody($body);
             $mail->addTo($email);
             $mail->addBcc('*****@*****.**');
             $mail->Send();
         }
     }
 }
 public function sendModification($array)
 {
     $email = $array['email'];
     if ($email != '') {
         $sellocation = Object\Location::getById($array['locationid'], 1);
         $parameters = array('bookingref' => $array['id'], 'partysize' => $array['partysize'], 'serving' => $array['servingtitle'], 'location' => $array['locationname'], 'date' => $array['start']->get('dd-MM-YYYY'), 'slot' => $array['start']->get('HH:mm'), 'preferredlanguage' => $array['preferredlanguage'], 'locationaddress' => $sellocation->getAddress(), 'locationzip' => $sellocation->getZip(), 'locationcity' => $sellocation->getCity(), 'locationtel' => $sellocation->getTel(), 'locationemail' => $sellocation->getEmail(), 'locationcity' => $sellocation->getCity(), 'locationurl' => $sellocation->getUrl(), 'guestname' => $array['firstlastname']);
         $mail = new Pimcore_Mail();
         $subject = 'Modification of Reservation';
         $mail->setParams($parameters);
         $mail->setReplyTo('*****@*****.**', $name = NULL);
         $mail->setSubject($subject);
         if ($array['preferredlanguage'] == "fr") {
             $mail->setDocument('/fr/booking/modification-confirmation');
         } else {
             $mail->setDocument('/fr/booking/modification-confirmation-en');
         }
         // $mail->setBody($body);
         $mail->addTo($email);
         $mail->addBcc('*****@*****.**');
         $mail->Send();
     }
 }
 public function sendConfirmation($array)
 {
     $email = $array['email'];
     $sellocation = Object\Location::getById($array['locationid'], 1);
     $parameters = array('bookingref' => $array['id'], 'partysize' => $array['partysize'], 'serving' => $array['servingtitle'], 'location' => $array['locationname'], 'date' => $array['start']->get('dd-MM-YYYY'), 'slot' => $array['start']->get('HH:mm'), 'locationaddress' => $sellocation->getAddress(), 'locationzip' => $sellocation->getZip(), 'locationcity' => $sellocation->getCity(), 'locationtel' => $sellocation->getTel(), 'locationemail' => $sellocation->getEmail(), 'locationcity' => $sellocation->getCity(), 'locationurl' => $sellocation->getUrl(), 'guestname' => $array['firstlastname']);
     $mail = new Pimcore_Mail();
     $subject = 'Reservation confirmation';
     $mail->setParams($parameters);
     $mail->setReplyTo('*****@*****.**', $name = NULL);
     $mail->setSubject($subject);
     $mail->setDocument('/fr/booking/reservation-confirmation');
     // $mail->setBody($body);
     $mail->addTo($email);
     $mail->addBcc('*****@*****.**');
     $mail->Send();
 }
 /**
  * Resends the email to the recipients
  */
 public function resendEmailAction()
 {
     $success = false;
     $emailLog = Document_Email_Log::getById($this->_getParam('id'));
     if ($emailLog instanceof Document_Email_Log) {
         $mail = new Pimcore_Mail('utf-8');
         $mail->preventDebugInformationAppending();
         if ($html = $emailLog->getHtmlLog()) {
             $mail->setBodyHtml($html);
         }
         if ($text = $emailLog->getTextLog()) {
             $mail->setBodyText($text);
         }
         $mail->setFrom($emailLog->getFrom());
         foreach ($emailLog->getToAsArray() as $entry) {
             $mail->addTo($entry['email'], $entry['name']);
         }
         foreach ($emailLog->getCcAsArray() as $entry) {
             $mail->addCc($entry['email'], $entry['name']);
         }
         foreach ($emailLog->getBccAsArray() as $entry) {
             $mail->addBcc($entry['email']);
         }
         $mail->setSubject($emailLog->getSubject());
         $mail->send();
         $success = true;
     }
     $this->_helper->json(array("success" => $success));
 }