Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The extension can also send email if tracking already added by DPD #7

Open
yohha opened this issue Jun 13, 2018 · 3 comments
Open

The extension can also send email if tracking already added by DPD #7

yohha opened this issue Jun 13, 2018 · 3 comments

Comments

@yohha
Copy link

yohha commented Jun 13, 2018

Thanks for the extension.
im using DPD extension to create labels and shipping the tracking number is added by DPD and getting "complete" status
is it possible to use your extension to sent the shipment mail?

@FossPrime
Copy link

FossPrime commented Jun 13, 2018

Your english could use some work.

            $block->addItem('keyup_massshipment_with_emails', array(
                'label'   => $helper->__('Send Tracking Email'),
                'url'     => Mage::helper("adminhtml")->getUrl('adminhtml/keyupShipment/massShipEmail'),
                'confirm' => $helper->__('Send a Tracking email to the selected orders, which have not had a tracking email sent before?'),
            ));

	/**
	 * Mass shipment action (with emails)
	 */
	public function massShipEmailAction() {
		if ( ($cnt = $this->_actionSendTracking()) !== false) {
			Mage::getSingleton('adminhtml/session')->addSuccess(
				Mage::helper('keyup_massshipment')->__('Total of %d orders emails sent', (int) $cnt)
			);
		} else {
			Mage::getSingleton('adminhtml/session')->addError(
				Mage::helper('keyup_massshipment')->__('Error shipping orders')
			);
		}

		$this->_redirect('adminhtml/sales_order/index');
	}

@yohha
Copy link
Author

yohha commented Jun 13, 2018

thanks for the code
but it still not sending the Tracking email!
Total of 0 orders were shipped (emails sent)

@yohha
Copy link
Author

yohha commented Jun 13, 2018

Where to i have to put the second code?
Keyup/MassShipment/Model/Observer.php
`public function massShipEmailAction() {
if ( ($cnt = $this->_actionSendTracking()) !== false) {
Mage::getSingleton('adminhtml/session')->addSuccess(
Mage::helper('keyup_massshipment')->('Total of %d orders emails sent', (int) $cnt)
);
} else {
Mage::getSingleton('adminhtml/session')->addError(
Mage::helper('keyup_massshipment')->
('Error shipping orders')
);
}

	$this->_redirect('adminhtml/sales_order/index');
}
/**
 * Add new mass actions to Orders grid
 *
 * @param Varien_Event_Observer $observer
 */
public function addMassAction(Varien_Event_Observer $observer) {
    $block = $observer->getEvent()->getBlock();

    if (
        $block instanceof Mage_Adminhtml_Block_Widget_Grid_Massaction
        && $block->getRequest()->getControllerName() == 'sales_order'
    ) {
        $helper = Mage::helper('keyup_massshipment');

        $block->addItem('keyup_massshipment_no_emails', array(
            'label'   => $helper->__('Ship (no emails)'),
            'url'     => Mage::helper("adminhtml")->getUrl('adminhtml/keyupShipment/massShip'),
            'confirm' => $helper->__('Are you sure?'),
        ));

        $block->addItem('keyup_massshipment_with_emails', array(
            'label'   => $helper->__('Send Tracking Email'),
            'url'     => Mage::helper("adminhtml")->getUrl('adminhtml/keyupShipment/massShipEmail'),
            'confirm' => $helper->__('Send a Tracking email to the selected orders, which have not had a tracking email sent before?')
        ));
        
    }
}

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants