feat(mail) : DTOs — MailFolderDto, MailMessageHeaderDto, MailAttachmentDto, MailMessageDetailDto
This commit is contained in:
15
src/Mail/Dto/MailAttachmentDto.php
Normal file
15
src/Mail/Dto/MailAttachmentDto.php
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Mail\Dto;
|
||||||
|
|
||||||
|
final readonly class MailAttachmentDto
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public string $partNumber,
|
||||||
|
public string $filename,
|
||||||
|
public string $mimeType,
|
||||||
|
public int $size,
|
||||||
|
) {}
|
||||||
|
}
|
||||||
16
src/Mail/Dto/MailFolderDto.php
Normal file
16
src/Mail/Dto/MailFolderDto.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Mail\Dto;
|
||||||
|
|
||||||
|
final readonly class MailFolderDto
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public string $path,
|
||||||
|
public string $displayName,
|
||||||
|
public ?string $parentPath,
|
||||||
|
public int $unreadCount,
|
||||||
|
public int $totalCount,
|
||||||
|
) {}
|
||||||
|
}
|
||||||
18
src/Mail/Dto/MailMessageDetailDto.php
Normal file
18
src/Mail/Dto/MailMessageDetailDto.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Mail\Dto;
|
||||||
|
|
||||||
|
final readonly class MailMessageDetailDto
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param list<MailAttachmentDto> $attachments
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public MailMessageHeaderDto $header,
|
||||||
|
public ?string $bodyHtml,
|
||||||
|
public ?string $bodyText,
|
||||||
|
public array $attachments,
|
||||||
|
) {}
|
||||||
|
}
|
||||||
25
src/Mail/Dto/MailMessageHeaderDto.php
Normal file
25
src/Mail/Dto/MailMessageHeaderDto.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Mail\Dto;
|
||||||
|
|
||||||
|
use DateTimeImmutable;
|
||||||
|
|
||||||
|
final readonly class MailMessageHeaderDto
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public int $uid,
|
||||||
|
public string $messageId,
|
||||||
|
public ?string $subject,
|
||||||
|
public string $fromAddress,
|
||||||
|
public ?string $fromName,
|
||||||
|
public array $toAddresses,
|
||||||
|
public ?array $ccAddresses,
|
||||||
|
public DateTimeImmutable $sentAt,
|
||||||
|
public bool $isRead,
|
||||||
|
public bool $isFlagged,
|
||||||
|
public bool $hasAttachments,
|
||||||
|
public ?string $snippet,
|
||||||
|
) {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user