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
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.
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 );
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