Extend the API with teh parameters from Swift

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-10-19 11:05:47 +02:00
parent ce27e8cf34
commit dcb322a6b3
No known key found for this signature in database
GPG key ID: E166FD8976B3BAC8
2 changed files with 27 additions and 3 deletions

View file

@ -45,11 +45,24 @@ class Message implements IMessage {
}
/**
* @param string $data
* @param string $filename
* @param string $contentType
* @return IAttachment
* @since 13.0.0
*/
public function createAttachment() {
return new Attachment(\Swift_Attachment::newInstance());
public function createAttachment($data = null, $filename = null, $contentType = null) {
return new Attachment(\Swift_Attachment::newInstance($data, $filename, $contentType));
}
/**
* @param string $path
* @param string $contentType
* @return IAttachment
* @since 13.0.0
*/
public function createAttachmentFromPath($path, $contentType = null) {
return new Attachment(\Swift_Attachment::fromPath($path, $contentType));
}
/**

View file

@ -30,10 +30,21 @@ namespace OCP\Mail;
interface IMessage {
/**
* @param string $data
* @param string $filename
* @param string $contentType
* @return IAttachment
* @since 13.0.0
*/
public function createAttachment();
public function createAttachment($data = null, $filename = null, $contentType = null);
/**
* @param string $path
* @param string $contentType
* @return IAttachment
* @since 13.0.0
*/
public function createAttachmentFromPath($path, $contentType = null);
/**
* @param IAttachment $attachment