Browse code

Delete export file if email option was used

Benjamin Roth authored on18/03/2025 14:22:33
Showing1 changed files
... ...
@@ -185,6 +185,12 @@ class ShopwareExportNewsletterJob extends AbstractController
185 185
             try
186 186
             {
187 187
                 $mailer->send($emailMessage);
188
+
189
+                // Delete the file after sending the email
190
+                if (file_exists($filename))
191
+                {
192
+                    unlink($filename);
193
+                }
188 194
                 if ($isCli)
189 195
                 {
190 196
                     $io->success('CSV file has been successfully sent to ' . $email);