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 ?