Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Call setPartsToBody reliably to fix issue #5 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fheyer
Copy link

@fheyer fheyer commented Jul 3, 2019

This is a fix for issue #5 (other mails are blank)

For all mail other than order, invoice, shipment, creditmemo (those with attachment) Mageplaza\EmailAttachments\Mail\Message::setPartsToBody is never called. That's why those mails don't have a body.

Longer explanation:
Problem is that line 54 from Mageplaza\EmailAttachments\Observer\AbstractEmail doesn't get called:

$this->mail->setTemplateVars($observer->getTransport());

So in turn Mageplaza\EmailAttachments\Model\Mail::$templateVars is null which makes Mageplaza\EmailAttachments\Model\MailEvent never call Mageplaza\EmailAttachments\Mail\Message::setPartsToBody (is only called if observer ran).

So the instance of Mageplaza\EmailAttachments\Mail\Message has an element in $parts but as setPartsToBody never gets called $zendMessage never gets a message body.

So in effect all other mails apart from those with attachment don't have a body.

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

Successfully merging this pull request may close these issues.

1 participant