refactor: mail interfaces
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -19,26 +19,35 @@ use KTXF\Resource\Provider\Node\NodePropertiesBaseInterface;
|
||||
*/
|
||||
interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
|
||||
public const JSON_TYPE = 'mail.message';
|
||||
public const JSON_PROPERTY_HEADERS = 'headers';
|
||||
public const JSON_PROPERTY_URID = 'urid';
|
||||
public const JSON_PROPERTY_DATE = 'date';
|
||||
public const JSON_PROPERTY_RECEIVED = 'received';
|
||||
public const JSON_PROPERTY_SIZE = 'size';
|
||||
public const JSON_PROPERTY_SENDER = 'sender';
|
||||
public const JSON_PROPERTY_FROM = 'from';
|
||||
public const JSON_PROPERTY_REPLY_TO = 'replyTo';
|
||||
public const JSON_PROPERTY_TO = 'to';
|
||||
public const JSON_PROPERTY_CC = 'cc';
|
||||
public const JSON_PROPERTY_BCC = 'bcc';
|
||||
public const JSON_PROPERTY_IN_REPLY_TO = 'inReplyTo';
|
||||
public const JSON_PROPERTY_REFERENCES = 'references';
|
||||
public const JSON_PROPERTY_SUBJECT = 'subject';
|
||||
public const JSON_PROPERTY_SNIPPET = 'snippet';
|
||||
public const JSON_PROPERTY_BODY = 'body';
|
||||
public const JSON_PROPERTY_ATTACHMENTS = 'attachments';
|
||||
public const JSON_PROPERTY_FLAGS = 'flags';
|
||||
public const JSON_PROPERTY_TAGS = 'tags';
|
||||
public const PROPERTY_SIZE = 'size';
|
||||
public const PROPERTY_HEADERS = 'headers';
|
||||
public const PROPERTY_URID = 'urid'; // mime message ID or similar unique identifier
|
||||
public const PROPERTY_IN_REPLY_TO = 'inReplyTo';
|
||||
public const PROPERTY_REFERENCES = 'references';
|
||||
public const PROPERTY_RECEIVED = 'received';
|
||||
public const PROPERTY_SENT = 'sent';
|
||||
public const PROPERTY_SENDER = 'sender';
|
||||
public const PROPERTY_REPLY_TO = 'replyTo';
|
||||
public const PROPERTY_FROM = 'from';
|
||||
public const PROPERTY_TO = 'to';
|
||||
public const PROPERTY_CC = 'cc';
|
||||
public const PROPERTY_BCC = 'bcc';
|
||||
public const PROPERTY_SUBJECT = 'subject';
|
||||
public const PROPERTY_BODY = 'body';
|
||||
public const PROPERTY_BODY_TEXT_PLAIN = 'bodyTextPlain';
|
||||
public const PROPERTY_BODY_TEXT_HTML = 'bodyTextHtml';
|
||||
public const PROPERTY_ATTACHMENTS = 'attachments';
|
||||
public const PROPERTY_FLAGS = 'flags';
|
||||
public const PROPERTY_TAGS = 'tags';
|
||||
|
||||
/**
|
||||
* Gets the message size in bytes
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getSize(): ?int;
|
||||
|
||||
/**
|
||||
* Gets custom headers
|
||||
@@ -70,13 +79,22 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
public function getUrid(): ?string;
|
||||
|
||||
/**
|
||||
* Gets the message date
|
||||
* Gets the message ID this is replying to
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return DateTimeImmutable|null
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDate(): ?DateTimeImmutable;
|
||||
public function getInReplyTo(): ?string;
|
||||
|
||||
/**
|
||||
* Gets the references (message IDs in thread)
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return array<int,string>
|
||||
*/
|
||||
public function getReferences(): array;
|
||||
|
||||
/**
|
||||
* Gets the received date
|
||||
@@ -88,13 +106,13 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
public function getReceived(): ?DateTimeImmutable;
|
||||
|
||||
/**
|
||||
* Gets the message size in bytes
|
||||
* Gets the sent date
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return int|null
|
||||
* @return DateTimeImmutable|null
|
||||
*/
|
||||
public function getSize(): ?int;
|
||||
public function getSent(): ?DateTimeImmutable;
|
||||
|
||||
/**
|
||||
* Gets the sender address (actual sender, may differ from From)
|
||||
@@ -149,24 +167,6 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
*/
|
||||
public function getBcc(): array;
|
||||
|
||||
/**
|
||||
* Gets the message ID this is replying to
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getInReplyTo(): ?string;
|
||||
|
||||
/**
|
||||
* Gets the references (message IDs in thread)
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return array<int,string>
|
||||
*/
|
||||
public function getReferences(): array;
|
||||
|
||||
/**
|
||||
* Gets the message subject
|
||||
*
|
||||
@@ -176,24 +176,6 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
*/
|
||||
public function getSubject(): string;
|
||||
|
||||
/**
|
||||
* Gets the message snippet/preview
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSnippet(): ?string;
|
||||
|
||||
/**
|
||||
* Checks if the message has any body content
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return bool True if text or HTML body is set
|
||||
*/
|
||||
public function hasBody(): bool;
|
||||
|
||||
/**
|
||||
* Gets the message body structure
|
||||
*
|
||||
@@ -203,6 +185,15 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
*/
|
||||
public function getBody(): ?MessagePartInterface;
|
||||
|
||||
/**
|
||||
* Checks if the message has any body content
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return bool True if text or HTML body is set
|
||||
*/
|
||||
public function hasBody(): bool;
|
||||
|
||||
/**
|
||||
* Gets the plain text body content
|
||||
*
|
||||
@@ -210,7 +201,7 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getBodyText(): ?string;
|
||||
public function getBodyTextPlain(): ?string;
|
||||
|
||||
/**
|
||||
* Gets the HTML body content
|
||||
@@ -219,7 +210,7 @@ interface MessagePropertiesBaseInterface extends NodePropertiesBaseInterface {
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getBodyHtml(): ?string;
|
||||
public function getBodyTextHtml(): ?string;
|
||||
|
||||
/**
|
||||
* Gets the attachments
|
||||
|
||||
Reference in New Issue
Block a user