summaryrefslogtreecommitdiffstats
path: root/lib/public/Mail
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-10-18 15:39:22 +0200
committerJoas Schilling <coding@schilljs.com>2017-10-18 15:44:19 +0200
commitce27e8cf34daea23117a9e5e0134957889aac332 (patch)
treec48d3cb82055d5fca1eb0f5cd3de466a7b7c477e /lib/public/Mail
parentcc798fd65f48e4cfc4748f35859c453a6eff4e25 (diff)
downloadnextcloud-server-ce27e8cf34daea23117a9e5e0134957889aac332.tar.gz
nextcloud-server-ce27e8cf34daea23117a9e5e0134957889aac332.zip
Add attachment support to emails
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/public/Mail')
-rw-r--r--lib/public/Mail/IAttachment.php53
-rw-r--r--lib/public/Mail/IMessage.php16
2 files changed, 68 insertions, 1 deletions
diff --git a/lib/public/Mail/IAttachment.php b/lib/public/Mail/IAttachment.php
new file mode 100644
index 00000000000..32348e7a309
--- /dev/null
+++ b/lib/public/Mail/IAttachment.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
+ *
+ * @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;
+
+/**
+ * Interface IAttachment
+ *
+ * @package OCP\Mail
+ * @since 13.0.0
+ */
+interface IAttachment {
+
+ /**
+ * @param string $filename
+ * @return $this
+ * @since 13.0.0
+ */
+ public function setFilename($filename);
+
+ /**
+ * @param string $contentType
+ * @return $this
+ * @since 13.0.0
+ */
+ public function setContentType($contentType);
+
+ /**
+ * @param string $body
+ * @return $this
+ * @since 13.0.0
+ */
+ public function setBody($body);
+
+}
diff --git a/lib/public/Mail/IMessage.php b/lib/public/Mail/IMessage.php
index 20e4ea19c4c..7f061cece05 100644
--- a/lib/public/Mail/IMessage.php
+++ b/lib/public/Mail/IMessage.php
@@ -22,12 +22,26 @@
namespace OCP\Mail;
/**
- * Class Message
+ * Interface IMessage
*
* @package OCP\Mail
* @since 13.0.0
*/
interface IMessage {
+
+ /**
+ * @return IAttachment
+ * @since 13.0.0
+ */
+ public function createAttachment();
+
+ /**
+ * @param IAttachment $attachment
+ * @return $this
+ * @since 13.0.0
+ */
+ public function attach(IAttachment $attachment);
+
/**
* Set the from address of this message.
*