1

I am working on custom extension and i need to use the default feature of Magento 2 to send the email once order status is being changed by admin from the backend. What file i need to look it for? Please see the screenshot enter image description here

3 Answers 3

1

Please visit this link...

https://github.com/magento/magento2/blob/135f967/app/code/Magento/Quote/Observer/Webapi/SubmitObserver.php#L40-L58

I think the right object is use Magento\Sales\Model\Order\Email\Sender\OrderSender;

and use the method "send"

In my case, checkAndSend was protected and I cannot use from external the class

1
  • I am talking about the email which sends while changing the order status from the order view page in admin with any comments as shown in screenshot. Jun 30, 2016 at 6:15
0

So here I'm using objecManager as I'm not into a module code approach, but it's works :

// this was needed for my custom script, if not I get a 'Missing required argument $debugHintsPath...'
$this->_state->setAreaCode(\Magento\Framework\App\Area::AREA_GLOBAL); 

$orderCommentSender = $this->_objectManager
          ->create('Magento\Sales\Model\Order\Email\Sender\OrderCommentSender');
$orderCommentSender->send($order, true, 'Here is a comment that will be displayed in the email');

It's sending an order status update.

Next, you can use Magento\Sales\Model\Order\Email\Sender\OrderSender for the order confirmation details.

0

My problem is, that magento sents the transactional eMails every time in english instead of my german, which is the language of the stores order and customer? Any idea to solve it? Confirmation from Admin is in german.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.