diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst index 654ca3b3830..b3c017b26d3 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.rst @@ -45,7 +45,8 @@ Back-end changes Added APIs ^^^^^^^^^^ -* tbd +* ``\OCP\Mail\IMessage::setSubject`` to set an email subject. See :ref:`email` for an example. +* ``\OCP\Mail\IMessage::setHtmlBody`` and ``\OCP\Mail\IMessage::setPlainBody`` to set an email body See :ref:`email` for an example. Changed APIs ^^^^^^^^^^^^ diff --git a/developer_manual/digging_deeper/email.rst b/developer_manual/digging_deeper/email.rst index 11856272f24..be39fd13cde 100644 --- a/developer_manual/digging_deeper/email.rst +++ b/developer_manual/digging_deeper/email.rst @@ -1,3 +1,5 @@ +.. _email: + ===== Email ===== @@ -25,6 +27,11 @@ The mailer is hidden behind the ``\OCP\Mail\IMailer`` interface that can be :ref public function notify(string $email): void { $message = $this->mailer->createMessage(); + $message->setSubject("Hello from Nextcloud"); + $message->setPlainBody("This is some text"); + $message->setHtmlBody( + "
This is some text" + ); $message->setTo([$email]); $this->mailer->send($message); }