fooman / emailattachments

Magento 1 Extension - add order confirmation, invoice, packing slip or creditmemo pdfs to your outgoing transactional emails. Also adds support for attaching terms and conditions and printing the order as a pdf.
http://store.fooman.co.nz/extensions/magento-extension-email-attachments.html
22 stars 22 forks source link

Mails are not send via Queue #25

Closed mbunge closed 8 years ago

mbunge commented 8 years ago

To send mails via queue, instead of send them directly add following line

$emailTemplate->setQueue($this->getQueue());

or

    public function send()
    {
        $helper = Mage::helper('emailattachments');
        // Send all emails from corresponding list
        while (!empty($this->_emailInfos)) {
            $emailTemplate = Mage::getModel('core/email_template');
            $emailInfo = array_pop($this->_emailInfos);
            $helper->debug('NEW EMAIL------------------------------------------');
            $helper->debug($emailInfo->getToNames());
            $this->dispatchAttachEvent($emailTemplate, $emailInfo);
            // Handle "Bcc" recepients of the current email
            $emailTemplate->addBcc($emailInfo->getBccEmails());
            //support queuing on newer Magento versions
            $emailTemplate->setQueue($this->getQueue());
            // Set required design parameters and delegate email sending to Mage_Core_Model_Email_Template
            $emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $this->getStoreId()))
                //send mail from queue
                ->setQueue($this->getQueue())
                ->sendTransactional(
                    $this->getTemplateId(),
                    $this->getSender(),
                    $emailInfo->getToEmails(),
                    $emailInfo->getToNames(),
                    $this->getTemplateParams(),
                    $this->getStoreId()
                );
            $helper->debug('FINISHED SENDING');
        }
        return $this;
    }

https://github.com/fooman/emailattachments/blob/master/app/code/community/Fooman/EmailAttachments/Model/Core/Email/Template/Mailer.php#L35

mbunge commented 8 years ago

I create a pull request #26 to solve this issue.

fooman commented 8 years ago

Closing issue as PR closed

EasyBizz commented 8 years ago

I'm sorry to comment on a closed issue, but I'm just checking to see if this is still an issue? With Mandrill, this is indeed how emailattachments acts since Magento's queue update. I'm looking for a solution to this problem and would love to know if the Fooman/Mandrill combination is something to keep considering or if I should look for another way to add attachments. Any help/updates are much appreciated.