Files
server/shared/lib/Mail/Entity/IAddress.php
2025-12-21 10:09:54 -05:00

54 lines
1.1 KiB
PHP

<?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;
}