Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients.
Often, mailings are to be sent not to the whole recipient list but only to a certain subgroup of recipients. Examples for such target groups are 'All recipients who read HTML format', 'Women', 'Men', 'People interested in product X', 'Recipients born after 1970', and so on. The Inx_Api_Filter_FilterManager can be used to create and retrieve
$oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME ); $oFilterManager = $oSession->getFilterManager(); $oFilter = $oFilterManager->createFilter( $oSystemListContext ); $oFilter->updateName( "New Yorker" ); $oFilter->updateStatement( "city LIKE \"New York\"" ); $oFilter->commitUpdate();
An Inx_Api_Filter_Filter can be assigned to an individual Inx_Api_Mailing_Mailing, as demonstrated in the following snippet:
$oMailing = ... $oMailing->updateFilterId( $oFilter->getId() ); $oMailing->commitUpdate();
The retrieval of Inx_Api_Filter_Filters can be accomplished using the selectAll() method to retrieve all filters, or one of the methods that expect an Inx_Api_List_ListContext to retrieve only the filters assigned to a specific list. The following snippet shows how to retrieve all filters belonging to the specified list, ordered by their creation date:
$oListContext = $oSession->getListContextManager()->findByName( "Desired list" ); $oFilterManager = $oSession->getFilterManager(); $oBOResultSet = $oFilterManager->select( $oListContext, Inx_Api_Filter_Filter::ATTRIBUTE_CREATION_DATETIME, Inx_Api_Order::ASC ); for( $i = 0; $i < $oBOResultSet->size(); $i++ ) { $oFilter = $oBOResultSet->get( $i ); echo $oFilter->getName()."<br>"; } $oBOResultSet->close();
Note: The usage of Inx_Api_Filter_Filters requires the api user right: Inx_Api_UserRights::FILTER_FEATURE_USE
For more information on filters and the filter statement syntax, see the Inx_Api_Filter_Filter documentation.
Located in /Api/Filter/FilterManager.php (line 65)
Inx_Api_BOManager | --Inx_Api_Filter_FilterManager
Creates a new filter that belongs to the specified list.
Creates a new filter that belongs to the specified list. To create a global filter, use the system list. The following snippet shows how to retrieve the Inx_Api_List_SystemListContext:
$oSystemListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
Returns an Inx_Api_BOResultSet containing all filters which belong to the specified list ordered by the specified order attribute and type.
Returns an Inx_Api_BOResultSet containing all filters which belong to the specified list ordered by the specified order attribute and type. To retrieve the global filters, use the system list.
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:24 +0200 by phpDocumentor 1.3.2