Skip to content

Commit befcf0f

Browse files
authored
feat: save eml into subfolders (#96)
1 parent b1f6fe1 commit befcf0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Services/EmlFileManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public function writeFile(string $id, string $content): string
2727
throw new \RuntimeException('Cannot compress eml file');
2828
}
2929

30-
$emlFilePath = 'mails/' . $id . '.eml.gz';
30+
$folderParts = \array_slice(\str_split($id, 2), 0, 3);
31+
32+
$emlFilePath = 'mails/' . \implode('/', $folderParts) . '/' . $id . '.eml.gz';
3133

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

0 commit comments

Comments
 (0)