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

Update MailEvent.php #34

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

Update MailEvent.php #34

wants to merge 1 commit into from

Conversation

sylphlv
Copy link

@sylphlv sylphlv commented Oct 18, 2021

Fix issue where if emails are sent asynchronously and an error occurs in the first Invoice that's sent, the next Invoice email will contain PDFs from the first Invoice.

Description

Set $this->parts to default value before attaching PDFs to email.

Manual testing scenarios

  1. Set Magento to send emails asynchronously (https://docs.magento.com/user-guide/configuration/sales/sales-emails.html);
  2. Enable attaching Invoice PDFs (path: mp_email_attachments/general/is_enabled_attach_pdf)
  3. Create first order by replicating issue in Fixing UTF-8 encoding for adress list #18 (for example, use ä (umlaut) in the customer name);
  4. Create second order;
  5. Invoice first & second orders;
  6. Wait for cron to send the emails OR run sales_send_order_invoice_emails cron with https://github.com/netz98/n98-magerun2

Without code changes from this PR, the second Invoice email will contain Invoice PDF from the first invoice.
This PR fixes this by setting $this->parts to the initial value.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)

Fix issue where if emails are sent asynchronously and an error occurs in the first Invoice that's sent, the next Invoice email will contain PDFs from the first Invoice.
@sylphlv
Copy link
Author

sylphlv commented Oct 18, 2021

Some priority would be nice on this, as it is a GDPR issue and can cause legal problems for people using this module.

@sylphlv
Copy link
Author

sylphlv commented Sep 30, 2022

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