data['from'] = $value; return $this; } /** * Get from email address * @return string */ public function getFrom(): string { return $this->data['from'] ?? ''; } /** * Set to email address * @param string $value * @return MailMergeMessage */ public function setTo(string $value): self { $this->data['to'] = $value; return $this; } /** * Get to email address * @return string */ public function getTo(): string { return $this->data['to'] ?? ''; } /** * Set subject * @param string $value * @return MailMergeMessage */ public function setSubject(string $value): self { $this->data['subject'] = $value; return $this; } /** * Get subject * @return string */ public function getSubject(): string { return $this->data['subject'] ?? ''; } /** * Set plain message body * @param string $value * @return MailMergeMessage */ public function setBodyPlain(string $value): self { $this->data['bodyPlain'] = $value; return $this; } /** * Get plain message body * @return string */ public function getBodyPlain(): string { return $this->data['bodyPlain'] ?? ''; } /** * Set html message body * @param string $value * @return MailMergeMessage */ public function setBodyHtml(string $value): self { $this->data['bodyHtml'] = $value; return $this; } /** * Get html message body * @return string */ public function getBodyHtml(): string { return $this->data['bodyHtml'] ?? ''; } /** * Set attachment * @param \OCA\Onlyoffice\MailMergeAttachment $attachment * @return MailMergeMessage */ public function setAttachment(MailMergeAttachment $attachment): self { $this->data['attachment'] = $attachment; return $this; } /** * Get attachment * @return MailMergeAttachment|null */ public function getAttachment(): ?MailMergeAttachment { return $this->data['attachment'] ?? null; } /** * Check if MailMergeMessage has attachment * @return bool */ public function hasAttachment(): bool { return $this->getAttachment() !== null; } }