diff options
Diffstat (limited to 'lib/private/Mail/Message.php')
-rw-r--r-- | lib/private/Mail/Message.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/Mail/Message.php b/lib/private/Mail/Message.php index 2d3c49d0ce1..b4d1e4dbe7a 100644 --- a/lib/private/Mail/Message.php +++ b/lib/private/Mail/Message.php @@ -23,6 +23,8 @@ namespace OC\Mail; +use OCP\Mail\IEMailTemplate; +use OCP\Mail\IMessage; use Swift_Message; /** @@ -30,7 +32,7 @@ use Swift_Message; * * @package OC\Mail */ -class Message { +class Message implements IMessage { /** @var Swift_Message */ private $swiftMessage; @@ -250,4 +252,15 @@ class Message { $this->swiftMessage->setBody($body, $contentType); return $this; } + + /** + * @param IEMailTemplate $emailTemplate + * @return $this + */ + public function useTemplate(IEMailTemplate $emailTemplate) { + $this->setSubject($emailTemplate->renderSubject()); + $this->setPlainBody($emailTemplate->renderText()); + $this->setHtmlBody($emailTemplate->renderHtml()); + return $this; + } } |