Initial Version
This commit is contained in:
53
shared/lib/Mail/Entity/IAddress.php
Normal file
53
shared/lib/Mail/Entity/IAddress.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXF\Mail\Entity;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
/**
|
||||
* Mail Address Interface
|
||||
*
|
||||
* Represents an email address with optional display name.
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
interface IAddress extends JsonSerializable {
|
||||
|
||||
public const JSON_PROPERTY_ADDRESS = 'address';
|
||||
public const JSON_PROPERTY_NAME = 'name';
|
||||
|
||||
/**
|
||||
* Gets the email address
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return string Email address (e.g., "user@example.com")
|
||||
*/
|
||||
public function getAddress(): string;
|
||||
|
||||
/**
|
||||
* Gets the display name
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return string|null Display name (e.g., "John Doe") or null
|
||||
*/
|
||||
public function getName(): ?string;
|
||||
|
||||
/**
|
||||
* Gets the formatted address string
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @return string Formatted as "Name <address>" or just "address" if no name
|
||||
*/
|
||||
public function toString(): string;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user