Skip to content

Commit

Permalink
feat: save eml into subfolders (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect authored Nov 2, 2024
1 parent b1f6fe1 commit befcf0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Services/EmlFileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public function writeFile(string $id, string $content): string
throw new \RuntimeException('Cannot compress eml file');
}

$emlFilePath = 'mails/' . $id . '.eml.gz';
$folderParts = \array_slice(\str_split($id, 2), 0, 3);

$emlFilePath = 'mails/' . \implode('/', $folderParts) . '/' . $id . '.eml.gz';

$this->filesystem->write($emlFilePath, $content);

Expand Down

0 comments on commit befcf0f

Please sign in to comment.