fromName = $fromName; $this->fromAddress = $fromAddress; $this->replyTo = $replyTo; $this->toAddress = $toAddress; $this->subject = $subject; $this->msgHtml = $msgHtml; $this->msgText = $msgText; $this->additionalMailHeader = $additionalMailHeader; $this->toUid = $toUid; } /** * {@inheritDoc} */ public function getFromName() { return $this->fromName; } /** * {@inheritDoc} */ public function getFromAddress() { return $this->fromAddress; } /** * {@inheritDoc} */ public function getReplyTo() { return $this->replyTo; } /** * {@inheritDoc} */ public function getToAddress() { return $this->toAddress; } /** * {@inheritDoc} */ public function getSubject() { return $this->subject; } /** * {@inheritDoc} */ public function getMessage(bool $plain = false) { if ($plain) { return $this->msgText; } else { return $this->msgHtml; } } /** * {@inheritDoc} */ public function getAdditionalMailHeader() { return $this->additionalMailHeader; } /** * {@inheritDoc} */ public function getRecipientUid() { return $this->toUid; } /** * Returns the current email with a new recipient * * @param string $email The email of the recipient * @param int $uid The (optional) UID of the recipient for further infos * * @return static */ public function withRecipient(string $email, int $uid = null) { $newEmail = clone $this; $newEmail->toAddress = $email; $newEmail->toUid = $uid; return $newEmail; } }