1

In my custom module I want to send email with invoice to another email. I have created the following script

<?php
namespace My\CustomScripts\Cron;

class SendInvoice
{

    protected $_invoiceSender;

    protected $_invoice;


    public function __construct(
        \Magento\Sales\Model\Order\Email\Sender\InvoiceSender $invoiceSender,
        \Magento\Sales\Model\Order\Invoice $invoice
    )
    {
        $this->_invoiceSender = $invoiceSender;
        $this->_invoice = $invoice;
    }

    public function execute()
    {
        $invoice_id = '000000025';
        $invoiceData = $this->_invoice->loadByIncrementId($invoice_id);
        $this->_invoiceSender->send($invoiceData, true);

        return $this;
    }

}

inresult i resievd en error: Warning: DOMDocument::schemaValidate(): Invalid Schema in /var/www/html/projecttest/vendor/magento/framework/Config/Dom.php on line 311

What is wrong ?

1
  • Seem that it relates to xml validation. Jan 26, 2018 at 13:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.