3 namespace Friendica\Object\EMail;
5 use Friendica\Util\Emailer;
9 * Interface for a single mail, which can be send through Emailer::send()
11 * @see Emailer::send()
13 interface IEmail extends JsonSerializable
16 * Gets the senders name for this email
20 function getFromName();
23 * Gets the senders email address for this email
27 function getFromAddress();
30 * Gets the UID of the sender of this email
34 function getRecipientUid();
37 * Gets the reply-to address for this email
41 function getReplyTo();
44 * Gets the senders email address
48 function getToAddress();
51 * Gets the subject of this email
55 function getSubject();
58 * Gets the message body of this email (either html or plaintext)
60 * @param boolean $plain True, if returned as plaintext
64 function getMessage(bool $plain = false);
67 * Gets any additional mail header
71 function getAdditionalMailHeader();
74 * Returns the current email with a new recipient
76 * @param string $address The email of the recipient
77 * @param int $uid The (optional) UID of the recipient for further infos
81 function withRecipient(string $address, int $uid);
84 * @param string $plaintext a new plaintext message for this email
85 * @param string $html a new html message for this email (optional)
89 function withMessage(string $plaintext, string $html = null);
94 function __toString();