The Inx_Api_Resource_ResourceManager manages the file resources.
The Inx_Api_Resource_ResourceManager manages the file resources. An Inx_Api_Resource_Resource can be used as attachment or embedded image in a mailing. Attachments and embedded images used in mailings are "resources". Using the ResourceManager, these resources can be upload to and download from the Inxmail server. Resources can be bound to mailing lists or mailings, which means they are not visible outside these bounds, and will be removed with their mailing list or mailing.
The following snippet shows how to upload a resource (logo.gif) which can be used by all mailings in all lists:
$oResourceManager = $oSession->getResourceManager(); $in = fopen("/images/logo.gif", 'rb'); $oResource = $oResourceManager->upload( null, "logo.gif", $in ); fclose($in);Inxmail assigns an unique identifier to the uploaded resource. To attach a resource to a mailing, add the attach tag to the mail body. The following snippet shows how to attach the resource with the id 42 to a mailing:
$sb = "[%attach(".$oResource->getId(). "); ".$res->getName(). "]" ;This results in a string like [%attach(42); logo.gif]. To embed an image instead of adding it as attachment, replace 'attach' with 'embedded-image': [%embedded-image(42); logo.gif].
To locate existing resources, use one of the select methods of the ResourceManager. The following snippet shows how to retrieve all Inx_Api_Resource_Resources available for a specific mailing and prints their IDs and names:
$oMailing = $oSession->getMailingManager()->get( 4711 ); $oResourceManager = $oSession->getResourceManager(); $oBOResultSet = $oResourceManager->select( $oMailing, Inx_Api_Resource_Resource::ATTRIBUTE_NAME, Inx_Api_Order::ASC ); for( $i = 0; $i < $oBOResultSet->size(); $i++ ) { $oResource = $oBOResultSet->get( $i ); echo $oResource->getId().": ".$oResource->getName()."<br>"; }
For more information on resources, see the Inx_Api_Resource_Resource documentation.
Located in /Api/Resource/ResourceManager.php (line 62)
Inx_Api_BOManager | --Inx_Api_Resource_ResourceManager
Returns an Inx_Api_BOResultSet containing all resources available for the given Inx_Api_Mailing_Mailing.
Returns an Inx_Api_BOResultSet containing all resources available for the given Inx_Api_Mailing_Mailing. This includes all non shared resources available for this mailing, list shared resources and system shared resources.
Uploads a file resource to Inxmail.
Uploads a file resource to Inxmail. The sharing type depends on the type of the $mOwner parameter:
Inherited From Inx_Api_BOManager
Inx_Api_BOManager::get()
Inx_Api_BOManager::remove()
Inx_Api_BOManager::selectAll()
Documentation generated on Thu, 17 Sep 2015 14:27:29 +0200 by phpDocumentor 1.3.2