Interface Inx_Api_MailingTemplate_MailingTemplateManager

Description

The Inx_Api_MailingTemplate_MailingTemplateManager can be used to manage mailing templates.

The Inx_Api_MailingTemplate_MailingTemplateManager can be used to manage mailing templates. This includes the retrieval and creation of Inx_Api_MailingTemplate_MailingTemplates. To retrieve or create a globally available mailing template, use the system list. The following snippet shows how to retrieve all global mailing templates ordered by name:

 $oMailingTemplateManager = $oSession->getMailingTemplateManager();
 $oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );

 $oBOResultSet = $oMailingTemplateManager->select( $oSystemListContext,
 	Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME, Inx_Api_Order::ASC );

 for( $i = 0; $i < $oBOResultSet->size(); $i++ )
 {
 	$oMailingTemplate = $oBOResultSet->get( $i );
 	echo $oMailingTemplate->getName()."<br>";
 }

 $oBOResultSet->close();
To retrieve all mailing templates, disregarding their list membership, use the inherited selectAll() method.

Be aware that mailing template names are not nullable and are unique in each list. However, it is possible to have two mailing templates with the same name in different lists. The following snippet shows how to create an Inx_Api_MailingTemplate_MailingTemplate and update its name:

 $oMailingTemplateManager = $oSession->getMailingTemplateManager();
 $oListContext = $oSession->getListContextManager()->findByName( "Name of the desired List" );
 $oMailingTemplate = $oMailingTemplateManager->createTemplate( $oListContext,
 	Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT );

 $oMailingTemplate->updateName( "Desired name" );
 $oMailingTemplate->commitUpdate();

The usage of mailing templates requires the api user right: Inx_Api_UserRights::TEMPLATE_FEATURE_USE

For more information on mailing templates, see the Inx_Api_MailingTemplate_MailingTemplate documentation.

Located in /Api/MailingTemplate/MailingTemplateManager.php (line 55)

Inx_Api_BOManager
   |
   --Inx_Api_MailingTemplate_MailingTemplateManager
Method Summary
Inx_Api_MailingTemplate_MailingTempalte createTemplate (Inx_Api_List_ListContext $oListContext, int $iMimeType)
Inx_Api_BOResultSet select (Inx_Api_List_ListContext $oListContext, [int $iOrderAttribute = -1], [int $iOrderType = -1])
Methods
createTemplate (line 70)

Creates a mailing template in the specified list with the specified MIME type.

Creates a mailing template in the specified list with the specified MIME type.

  • return: a new mailing template.
  • access: public
Inx_Api_MailingTemplate_MailingTempalte createTemplate (Inx_Api_List_ListContext $oListContext, int $iMimeType)
  • Inx_Api_List_ListContext $oListContext: the list this template belongs to.
  • int $iMimeType: the MIME type of this template. May be one of:
    • Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_HTML_TEXT,
    • Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_PLAIN_TEXT or
    • Inx_Api_MailingTemplate_MailingTemplate::MIME_TYPE_MULTIPART
select (line 94)

Returns an Inx_Api_BOResultSet containing all mailing templates assigned to the given list, ordered by the given attribute and order type.

Returns an Inx_Api_BOResultSet containing all mailing templates assigned to the given list, ordered by the given attribute and order type. To retrieve the globally available mailing templates, use the system list. The following snippet shows how to retrieve the system list context:

 $oSystemListContext = $oSession->getListContextManager()->findByName(
 	Inx_Api_List_SystemListContext::NAME );

  • return: an Inx_Api_BOResultSet containing all mailing templates assigned to the given list.
  • access: public
Inx_Api_BOResultSet select (Inx_Api_List_ListContext $oListContext, [int $iOrderAttribute = -1], [int $iOrderType = -1])
  • Inx_Api_List_ListContext $oListContext: all mailing templates assigned to this list will be fetched. This parameter may <strong>not</strong> be null. If you wish to retrieve all mailing templates, use selectAll() instead.
  • int $iOrderAttribute: the id of the attribute used to order the result (only Inx_Api_MailingTemplate_MailingTemplate::ATTRIBUTE_NAME). Be aware that any other attribute as well as ommitting this parameter will default to the name attribute.
  • int $iOrderType: the order type (Inx_Api_Order::ASC or Inx_Api_Order::DESC). May be ommitted if $iOrderAttribute is ommitted as well.

Inherited Methods

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:27 +0200 by phpDocumentor 1.3.2