aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Mail
diff options
context:
space:
mode:
authorArne Hamann <kontakt+github@arne.email>2019-03-16 02:29:03 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-24 20:57:27 +0100
commita16aa995866d3319d9f848e0d5811786fad2f223 (patch)
tree0bf8b897114b43c3708573badbf48867034d556a /lib/public/Mail
parent3e338c907533dd77599b576ecfadd44b3d1a9855 (diff)
downloadnextcloud-server-a16aa995866d3319d9f848e0d5811786fad2f223.tar.gz
nextcloud-server-a16aa995866d3319d9f848e0d5811786fad2f223.zip
Added Hook before Message is send
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
Diffstat (limited to 'lib/public/Mail')
-rw-r--r--lib/public/Mail/Events/BeforeMessageSent.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/public/Mail/Events/BeforeMessageSent.php b/lib/public/Mail/Events/BeforeMessageSent.php
new file mode 100644
index 00000000000..e14a35750f0
--- /dev/null
+++ b/lib/public/Mail/Events/BeforeMessageSent.php
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright 2020 Arne Hamann <github@arne.email>
+ *
+ * @author Arne Hamann <github@arne.email>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Mail\Events;
+
+use OCP\EventDispatcher\Event;
+use OCP\Mail\IMessage;
+
+/**
+ * @since 19.0.0
+ */
+class BeforeMessageSent extends Event {
+
+ /** @var IMessage */
+ private $message;
+
+ /**
+ * @param IMessage $message
+ * @since 19.0.0
+ */
+ public function __construct(IMessage $message) {
+ parent::__construct();
+ $this->message = $message;
+ }
+
+ /**
+ * @return IMessage
+ * @since 19.0.0
+ */
+ public function getMessage(): IMessage {
+ return $this->message;
+ }
+
+}