Extend the API with teh parameters from Swift
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ce27e8cf34
commit
dcb322a6b3
2 changed files with 27 additions and 3 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue