mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #38585 from nextcloud/feature/ocp/send-message-with-subject-body
feat(ocp): Allow sending emails with subject and body
This commit is contained in:
commit
c0263b91d4
2 changed files with 30 additions and 13 deletions
|
|
@ -207,11 +207,6 @@ class Message implements IMessage {
|
|||
return $this->bcc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the subject of this message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubject(string $subject): IMessage {
|
||||
$this->symfonyEmail->subject($subject);
|
||||
return $this;
|
||||
|
|
@ -224,10 +219,6 @@ class Message implements IMessage {
|
|||
return $this->symfonyEmail->getSubject() ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the plain-text body of this message.
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlainBody(string $body): IMessage {
|
||||
$this->symfonyEmail->text($body);
|
||||
return $this;
|
||||
|
|
@ -242,10 +233,6 @@ class Message implements IMessage {
|
|||
return $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HTML body of this message. Consider also sending a plain-text body instead of only an HTML one.
|
||||
* @return $this
|
||||
*/
|
||||
public function setHtmlBody(string $body): IMessage {
|
||||
if (!$this->plainTextOnly) {
|
||||
$this->symfonyEmail->html($body);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,36 @@ namespace OCP\Mail;
|
|||
* @since 13.0.0
|
||||
*/
|
||||
interface IMessage {
|
||||
/**
|
||||
* Set the subject of this message
|
||||
*
|
||||
* @param string $subject
|
||||
*
|
||||
* @return self
|
||||
* @since 28.0.0
|
||||
*/
|
||||
public function setSubject(string $subject): IMessage;
|
||||
|
||||
/**
|
||||
* Set the plain-text body of this message
|
||||
*
|
||||
* @param string $body
|
||||
*
|
||||
* @return self
|
||||
* @since 28.0.0
|
||||
*/
|
||||
public function setPlainBody(string $body): IMessage;
|
||||
|
||||
/**
|
||||
* Set the HTML body of this message. Consider also sending a plain-text body instead of only an HTML one.
|
||||
*
|
||||
* @param string $body
|
||||
*
|
||||
* @return self
|
||||
* @since 28.0.0
|
||||
*/
|
||||
public function setHtmlBody(string $body): IMessage;
|
||||
|
||||
/**
|
||||
* @param IAttachment $attachment
|
||||
* @return IMessage
|
||||
|
|
|
|||
Loading…
Reference in a new issue