account = $account; $this->to = $to; $this->cc = $cc; $this->bcc = $bcc; $this->subject = $subject; $this->body = $body; $this->attachments = $attachments; $this->isHtml = $isHtml; $this->isMdnRequested = $isMdnRequested; $this->smimeCertificateId = $smimeCertificateId; $this->smimeSign = $smimeSign; $this->smimeEncrypt = $smimeEncrypt; } /** * @param Account $account * @param string $subject * @param string $body * @param string|null $to * @param string|null $cc * @param string|null $bcc * @param array $attachments * @param bool $isHtml * @param bool $requestMdn * @param int|null $smimeCertificateId * @param bool $smimeSign * @return NewMessageData */ public static function fromRequest(Account $account, string $subject, string $body, ?string $to = null, ?string $cc = null, ?string $bcc = null, array $attachments = [], bool $isHtml = true, bool $requestMdn = false, ?int $smimeCertificateId = null, bool $smimeSign = false, bool $smimeEncrypt = false): NewMessageData { $toList = AddressList::parse($to ?: ''); $ccList = AddressList::parse($cc ?: ''); $bccList = AddressList::parse($bcc ?: ''); return new self( $account, $toList, $ccList, $bccList, $subject, $body, $attachments, $isHtml, $requestMdn, $smimeCertificateId, $smimeSign, $smimeEncrypt, ); } /** * @return Account */ public function getAccount(): Account { return $this->account; } /** * @return AddressList */ public function getTo(): AddressList { return $this->to; } /** * @return AddressList */ public function getCc(): AddressList { return $this->cc; } /** * @return AddressList */ public function getBcc(): AddressList { return $this->bcc; } /** * @return string */ public function getSubject(): string { return $this->subject; } /** * @return string */ public function getBody(): string { return $this->body; } /** * @return array */ public function getAttachments(): array { return $this->attachments; } public function isHtml(): bool { return $this->isHtml; } public function isMdnRequested(): bool { return $this->isMdnRequested; } public function getSmimeSign(): bool { return $this->smimeSign; } public function getSmimeCertificateId(): ?int { return $this->smimeCertificateId; } public function getSmimeEncrypt(): bool { return $this->smimeEncrypt; } }