public function contactSendAction() { if ($_SERVER['REQUEST_METHOD'] == "POST") { $json = $this->captchaCheck($_POST); // var_dump($json->match); if (!$json->match) { throw new Exception("Captcha parameters does not match!!", 666); } $mail = new Pimcore_Mail(); $mail->addTo($_POST['email']); $mail->setBodyText($_POST['comments']); $mail->send(); die; } throw new Exception("This request method is not supperted here!!", 666); }
protected function sendConfirmationMail(OnlineShop_Framework_ICart $cart, OnlineShop_Framework_AbstractOrder $order) { $params = array(); $params["cart"] = $cart; $params["order"] = $order; $params["ordernumber"] = $order->getOrdernumber(); if ($order->getCustomer()) { $params["customer"] = $order->getCustomer(); $email = $order->getCustomer()->getEmail(); } else { $tmpCustomer = new Object_Customer(); $tmpCustomer->setEmail($order->getGuestEmail()); $tmpCustomer->setFirstname($order->getDeliveryAddressLine1()); $tmpCustomer->setLastname($order->getDeliveryAddressLine2()); $params["customer"] = $tmpCustomer; $email = $order->getGuestEmail(); } $mail = new Pimcore_Mail(array("document" => $this->confirmationMail, "params" => $params)); $mail->addTo($email); $mail->send(); }
public function checkErrorLogsDb() { $conf = Config::getSystemConfig(); $config = $conf->applicationlog; if ($config->mail_notification->send_log_summary) { $receivers = preg_split("/,|;/", $config->mail_notification->mail_receiver); array_walk($receivers, function (&$value) { $value = trim($value); }); $logLevel = (int) $config->mail_notification->filter_priority; $db = \Pimcore\Resource::get()->getResource(); $query = "SELECT * FROM " . \Pimcore\Log\Helper::ERROR_LOG_TABLE_NAME . " WHERE maintenanceChecked IS NULL AND priority <= {$logLevel} order by id desc"; $rows = $db->fetchAll($query); $limit = 100; $rowsProcessed = 0; $rowCount = count($rows); if ($rowCount) { while ($rowsProcessed < $rowCount) { $entries = array(); if ($rowCount <= $limit) { $entries = $rows; } else { for ($i = $rowsProcessed; $i < $rowCount && count($entries) < $limit; $i++) { $entries[] = $rows[$i]; } } $rowsProcessed += count($entries); $html = var_export($entries, true); $html = "<pre>{$html}</pre>"; $mail = new \Pimcore_Mail(); $mail->setBodyHtml($html); $mail->addTo($receivers); $mail->setSubject('Error Log ' . \Pimcore_Tool::getHostUrl()); $mail->send(); } } $db->query("UPDATE " . \Pimcore\Log\Helper::ERROR_LOG_TABLE_NAME . " set maintenanceChecked = 1"); } }
/** * 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)); }