Fix email attachment handling in address import reports

Updated attachment logic to use in-memory file contents and apply a `.gz` suffix to filenames. This ensures better file handling and resolves potential issues with attaching files directly from a path.
This commit is contained in:
Julien Fastré 2025-01-10 23:00:40 +01:00
parent b4a1e824ac
commit 6de4861b98
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -311,7 +311,7 @@ final class AddressReferenceBaseImporter
$email = (new Email())
->addTo($sendAddressReportToEmail)
->subject('Addresses that could not be imported')
->attachFromPath($attachmentPath);
->attach(file_get_contents($attachmentPath), sprintf('%s.gz', $path));
try {
$this->mailer->send($email);