/**
* @since 13.0.0
+ * @return $this
*/
public function attach(IAttachment $attachment): IMessage {
/** @var Attachment $attachment */
* If no "From" address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php
*
* @param array $addresses Example: array('sender@domain.org', 'other@domain.org' => 'A name')
+ * @return $this
*/
public function setFrom(array $addresses): IMessage {
$this->from = $addresses;
/**
* Set the Reply-To address of this message
+ * @return $this
*/
public function setReplyTo(array $addresses): IMessage {
$this->replyTo = $addresses;
* Set the to addresses of this message.
*
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
+ * @return $this
*/
public function setTo(array $recipients): IMessage {
$this->to = $recipients;
* Set the CC recipients of this message.
*
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
+ * @return $this
*/
public function setCc(array $recipients): IMessage {
$this->cc = $recipients;
* Set the BCC recipients of this message.
*
* @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
+ * @return $this
*/
public function setBcc(array $recipients): IMessage {
$this->bcc = $recipients;
return $this->bcc;
}
+ /**
+ * @return $this
+ */
public function setSubject(string $subject): IMessage {
$this->symfonyEmail->subject($subject);
return $this;
return $this->symfonyEmail->getSubject() ?? '';
}
+ /**
+ * @return $this
+ */
public function setPlainBody(string $body): IMessage {
$this->symfonyEmail->text($body);
return $this;
return $body;
}
+ /**
+ * @return $this
+ */
public function setHtmlBody(string $body): IMessage {
if (!$this->plainTextOnly) {
$this->symfonyEmail->html($body);
return $this->symfonyEmail;
}
+ /**
+ * @return $this
+ */
public function setBody(string $body, string $contentType): IMessage {
if (!$this->plainTextOnly || $contentType !== 'text/html') {
if ($contentType === 'text/html') {
$this->symfonyEmail->bcc(...$this->convertAddresses($this->getBcc()));
}
+ /**
+ * @return $this
+ */
public function useTemplate(IEMailTemplate $emailTemplate): IMessage {
$this->setSubject($emailTemplate->renderSubject());
$this->setPlainBody($emailTemplate->renderText());