Interface Inx_Api_GeneralMailing_GeneralMailingManager

Description

The Inx_Api_GeneralMailing_GeneralMailingManager enables read-only access to mailings of various types.

The Inx_Api_GeneralMailing_GeneralMailingManager enables read-only access to mailings of various types. These mailings can be accessed through the Inx_Api_GeneralMailing_GeneralMailing business object. In order to create or edit a mailing, the corresponding specialized manager has to be used. This may also be necessary for access to mailing type specific functionality. The specialized managers are:

  • Inx_Api_Mailing_MailingManager for normal mailings
  • Inx_Api_TriggerMailing_TriggerMailingManager for trigger mailings
Mailing retrieval Mailings can be retrieved via a Inx_Api_GeneralMailing_GeneralMailingQuery. A query object can be created by calling the method createQuery(). This will create a new query object without any preset filter. In order to find specific mailings, the corresponding filters have to be added to the query before executing it. For an example on how to do so, see the Inx_Api_GeneralMailing_GeneralMailingQuery documentation.

The following snippet shows how to create and execute a query that retrieves all accessible mailings in the system:

 $oGeneralMailingManager = $oSession->getGeneralMailingManager();
 $oGeneralMailingQuery = $oGeneralMailingManager->createQuery();

 $oROBOResultSet = $oGeneralMailingQuery->executeQuery();

 foreach( $oROBOResultSet as $oMailing )
 {
 	echo $oMailing->getName()."<br>";
 }

 $oROBOResultSet->close();
This provides the same result as a call to selectAll().

Preview generation

To create a preview of a mailing, an Inx_Api_Rendering_GeneralMailingRenderer is needed. It can be obtained using createRenderer() or createRendererForTestRecipient().

The following snippet shows how to create an Inx_Api_Rendering_GeneralMailingRenderer and generate a preview of the mailing:

 $oManager = $oSession->getGeneralMailingManager();
 $oRenderer = $oManager->createRenderer();
 $oRenderer->parse( 1, Inx_Api_Rendering_BuildMode::PREVIEW() );
 $oContent = $oRenderer->build( $iRecipientId );

 echo $oContent->getPlainText();
Note: To access mailings, the following api user right is required: Inx_Api_UserRights::MAILING_FEATURE_USE

Located in /Api/GeneralMailing/GeneralMailingManager.php (line 67)

Inx_Api_ROBOManager
   |
   --Inx_Api_GeneralMailing_GeneralMailingManager
Method Summary
Methods
createQuery (line 75)

Creates and initializes a new Inx_Api_GeneralMailing_GeneralMailingQuery object without any query filter.

Creates and initializes a new Inx_Api_GeneralMailing_GeneralMailingQuery object without any query filter.

  • return: a new initialized GeneralMailingQuery
  • access: public
createRenderer (line 83)

Creates a new Inx_Api_Rendering_GeneralMailingRenderer which can be used to render an Inx_Api_GeneralMailing_GeneralMailing.

Creates a new Inx_Api_Rendering_GeneralMailingRenderer which can be used to render an Inx_Api_GeneralMailing_GeneralMailing.

  • return: a new GeneralMailingRenderer.
  • access: public
createRendererForTestRecipient (line 91)

Creates a new Inx_Api_Rendering_GeneralMailingRenderer which can be used to render a Inx_Api_GeneralMailing_GeneralMailing personalized with a test recipient instead of an ordinary recipient.

Creates a new Inx_Api_Rendering_GeneralMailingRenderer which can be used to render a Inx_Api_GeneralMailing_GeneralMailing personalized with a test recipient instead of an ordinary recipient.

  • return: a new GeneralMailingRenderer for test recipients.
  • access: public
Inx_Api_Rendering_GeneralMailingRenderer createRendererForTestRecipient ()

Inherited Methods

Inherited From Inx_Api_ROBOManager

Inx_Api_ROBOManager::get()
Inx_Api_ROBOManager::selectAll()

Documentation generated on Thu, 17 Sep 2015 14:27:25 +0200 by phpDocumentor 1.3.2