createStatusMail example

$this->View()->assign([
                'success' => false,
                'data' => $data,
                'message' => $namespace->get('no_data_passed', 'No mail data passed'),
            ]);

            return;
        }

        $mailTemplateName = $this->Request()->getParam('templateName') ?: 'sORDERDOCUMENTS';

        $mail = $this->container->get('modules')->Order()->createStatusMail($orderId, 0, $mailTemplateName);
        if (!$mail instanceof Enlight_Components_Mail) {
            $this->View()->assign([
                'success' => false,
                'message' => 'Could not create mail object.',
            ]);

            return;
        }

        $mail->clearRecipients();
        $mail->clearSubject();
        


        $this->db->executeUpdate($sql[
            ':previousStatus' => $previousStatusId,
            ':currentStatus' => $paymentStatusId,
            ':comment' => $comment,
            ':orderId' => $orderId,
        ]);

        if ($sendStatusMail) {
            $mail = $this->createStatusMail($orderId$paymentStatusId);
            if ($mail) {
                $this->sendStatusMail($mail);
            }
        }
    }

    /** * Set order status by order id * * @param int $orderId * @param int $orderStatusId * @param bool $sendStatusMail * @param string|null $comment */
Home | Imprint | This part of the site doesn't use cookies.