src/Checkout/OrderEmailNotifier.php
public function sendStatusChange($title, $note = null)
    {
        if (!$note) {
            $latestLog = OrderStatusLog::get()
                ->filter("OrderID", $this->order->ID)
                ->filter("SentToCustomer", 1)
                ->first();

            if ($latestLog) {
                $note = $latestLog->Note;
                $title = $latestLog->Title;
            }
        }

        if (Config::inst()->get(OrderProcessor::class, 'receipt_email')) {
            $adminEmail = Config::inst()->get(OrderProcessor::class, 'receipt_email');
        } else {
            $adminEmail = Email::config()->admin_email;
        }

        /**
         * @var Email $e
         */
        $email = Email::create()
            ->setFrom($adminEmail)
            ->setSubject(_t('SilverShop\ShopEmail.StatusChangeSubject', 'SilverShop – {Title}', ['Title' => $title]))
            ->setTo($this->order->getLatestEmail())
            ->setHTMLTemplate('SilverShop/Model/Order_StatusEmail')
            ->setData(
                [
                    'Order' => $this->order,
                    'Note' => $note,
                    'FromEmail' => $adminEmail
                ]
            );

        if ($this->debugMode) {
            return $this->debug($email);
        } else {
            return $email->send();
        }
    }
public function sendStatusChange($title, $note = null)
    {
        if (!$note) {
            $latestLog = OrderStatusLog::get()
                ->filter("OrderID", $this->order->ID)
                ->filter("SentToCustomer", 1)
                ->first();

            if ($latestLog) {
                $note = $latestLog->Note;
                $title = $latestLog->Title;
            }
        }

        if (Config::inst()->get(OrderProcessor::class, 'receipt_email')) {
            $adminEmail = Config::inst()->get(OrderProcessor::class, 'receipt_email');
        } else {
            $adminEmail = Email::config()->admin_email;
        }

        /**
         * @var Email $e
         */
        $email = Email::create()
            ->setFrom($adminEmail)
            ->setSubject(_t('SilverShop\ShopEmail.StatusChangeSubject', 'SilverShop – {Title}', ['Title' => $title]))
            ->setTo($this->order->getLatestEmail())
            ->setHTMLTemplate('SilverShop/Model/Order_StatusEmail')
            ->setData(
                [
                    'Order' => $this->order,
                    'Note' => $note,
                    'FromEmail' => $adminEmail
                ]
            );

        if ($this->debugMode) {
            return $this->debug($email);
        } else {
            return $email->send();
        }
    }
Send an email to the customer containing the latest note of {@link OrderStatusLog} and the current status.

@param string $title Subject for email
@param string $note  Optional note-content (instead of using the OrderStatusLog)

@return bool|string