Where do I click to send an Order Update email? I'd like to send an email to the customer when I post out their item.
1 Answer
how to send update mail in magento
public function __construct(
....
\Magento\Sales\Model\OrderFactory $orderFactory,
\Magento\Framework\ObjectManagerInterface $objectManager,
....
) {
....
$this->orderFactory = $orderFactory;
$this->_objectManager= $objectManager;
....
}
public function execute()
{
$order_sales = $this->orderFactory->create()->load($orderId);//your order id
$orderCommentSender = $this->_objectManager->create('Magento\Sales\Model\Order\Email\Sender\OrderCommentSender');
$orderCommentSender->send($order_sales, $notify='1' , $comment);// $comment yout comment
}