コード例 #1
0
 /**
  * @param Mirasvit_Helpdesk_Model_Ticket $ticket
  */
 public function sendNotificationReminder($ticket)
 {
     $templateName = $this->getConfig()->getNotificationReminderTemplate();
     $recipientEmail = $ticket->getFpRemindEmail();
     $recipientName = '';
     $config = Mage::getSingleton('helpdesk/config');
     if ($config->getDeveloperIsActive()) {
         if ($sandboxEmail = $config->getDeveloperSandboxEmail()) {
             $recipientEmail = $sandboxEmail;
         }
     }
     $ticket = Mage::getModel('helpdesk/ticket')->getCollection()->joinFields()->addFieldToFilter('ticket_id', $ticket->getId())->getFirstItem();
     $department = Mage::getModel('helpdesk/department')->load($ticket->getDepartmentId());
     $customer = $ticket->getCustomer();
     $user = Mage::getModel('admin/user')->load($ticket->getUserId());
     $store = Mage::getModel('core/store')->load($ticket->getStoreId());
     $variables = array('ticket' => $ticket, 'customer' => $customer, 'user' => $user, 'department' => $department, 'store' => $store);
     $senderName = Mage::getStoreConfig("trans_email/ident_{$this->getSender()}/name");
     $senderEmail = Mage::getStoreConfig("trans_email/ident_{$this->getSender()}/email");
     $this->send($templateName, $senderName, $senderEmail, $recipientEmail, $recipientName, $variables, $ticket->getStoreId());
 }