0

Magento 2 send order & invoice email manually

This may related but it doesn't solve my problem. Any ideas or specific approach?

1 Answer 1

0
<?php
namespace My\Module\Plugin;

class CheckOrderTypeAndSendEmail
{
 
    public function aroundSave(\Magento\Sales\Model\AdminOrder\EmailSender $subject, callable $proceed)
    {
        // write your logic here to find what kind of payment method was used
        if ($this->validPayment($subject->getOrder())) {
            return $proceed(); // it goes ahead and sends email
        }
        return null;
    }
}

http://www.rosenborgsolutions.com/how-to-extend-magento-part-1.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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