3 namespace Friendica\Object\EMail;
5 use Friendica\Core\L10n;
6 use Friendica\Util\Emailer;
10 * Interface for a single mail, which can be send through Emailer::send()
12 * @see Emailer::send()
14 interface IEmail extends JsonSerializable
17 * Gets the senders name for this email
21 function getFromName();
24 * Gets the senders email address for this email
28 function getFromAddress();
31 * Gets the UID of the sender of this email
35 function getRecipientUid();
38 * Gets the reply-to address for this email
42 function getReplyTo();
45 * Gets the senders email address
49 function getToAddress();
52 * Gets the subject of this email
56 function getSubject();
59 * Gets the message body of this email (either html or plaintext)
61 * @param boolean $plain True, if returned as plaintext
65 function getMessage(bool $plain = false);
68 * Gets any additional mail header
72 function getAdditionalMailHeader();
75 * Returns the current email with a new recipient
77 * @param string $address The email of the recipient
78 * @param int $uid The (optional) UID of the recipient for further infos
82 function withRecipient(string $address, int $uid);
85 * @param string $plaintext a new plaintext message for this email
86 * @param string $html a new html message for this email (optional)
90 function withMessage(string $plaintext, string $html = null);
95 function __toString();