Interface Inx_Api_TextModule_TextModule

Description

This class defines a text module.

This class defines a text module. Text modules are reusable text snippets that can be used inside mailings in the same list (or all lists if the text module is defined in the system list). A common text module is a custom, personalized salutation which will be shown later. You can update both of the content types (plain Text and html) but via the client only the one(s) defined by the MIME type will be used. Also, the text module name may be updated, though NOT the MIME type. If you wish to alter the MIME type, you have to delete the text module and create a new one with the values of the old text module and the new MIME type.

The following snippet shows how to create a global custom salutation text module using the user defined recipient attributes 'Surname', 'First name' and 'Gender':

 $oTextModuleManager = $oSession->getTextmoduleManager();
 $oListContext = $oSession->getListContextManager()->findByName( Inx_Api_List_SystemListContext::NAME );
 $oTextModule = $oTextModuleManager->createTextmodule( $oListContext, Inx_Api_TextModule_TextModule::MIME_TYPE_PLAIN_TEXT );

 $sContent = "[%if Surname IS_EMPTY]Dear Sir or Madam,\n";
 $sContent .= "[%elseif Column(\"Gender\") = \"m\"]Dear Mr ";
 $sContent .= "[First name,postfix( )][Surname], \n";
 $sContent .= "[%elseif Column(\"Gender\") = \"f\"]Dear Ms ";
 $sContent .= "[First name, postfix( )][Surname], \n ";
 $sContent .= "[%else]Dear Sir or Madam,[%endif] \n ";

 $oTextModule->updateName( "salutation" );
 $oTextModule->updatePlainTextContent( $sContent );
 $oTextModule->commitUpdate();

For more information on the possible contents of text modules, see the corresponding section of the Inxmail client manual.

For an example on how to retrieve existing text modules, see the In_Api_TextModule_TextModuleManager documentation.

  • version: $Revision: 9497 $ $Date: 2007-12-19 17:03:25 +0200 (Tr, 19 Grd 2007) $ $Author: aurimas $
  • see: In_Api_TextModule_TextModuleManager
  • since: API 1.4.0

Located in /Api/TextModule/TextModule.php (line 48)

Inx_Api_BusinessObject
   |
   --Inx_Api_TextModule_TextModule
Class Constant Summary
Method Summary
string getHtmlTextContent ()
int getMimeType ()
string getName ()
void updateHtmlTextContent (string $sHtmlTextContent)
void updateName (string $sName)
void updatePlainTextContent (string $sPlainTextContent)
Methods
getHtmlTextContent (line 132)

Returns the HTML text part of this text module, or null if the MIME type is MIME_TYPE_PLAIN_TEXT.

Returns the HTML text part of this text module, or null if the MIME type is MIME_TYPE_PLAIN_TEXT.

  • return: the HTML text part of this text module, if any.
  • access: public
string getHtmlTextContent ()
getListContextId (line 113)

Returns the id of the list which this text module belongs to.

Returns the id of the list which this text module belongs to.

  • return: the id of the list which this text module belongs to.
  • access: public
int getListContextId ()
getMimeType (line 125)

Returns the MIME type of this text module.

Returns the MIME type of this text module. May be one of:

  • MIME_TYPE_HTML_TEXT: Only HTML text
  • MIME_TYPE_PLAIN_TEXT: Only plain text
  • MIME_TYPE_MULTIPART: Both, HTML and plain text

  • return: the MIME type of this text module.
  • access: public
int getMimeType ()
getName (line 98)

Returns the name of this text module.

Returns the name of this text module.

  • return: the name of this text module.
  • access: public
string getName ()
getPlainTextContent (line 147)

Returns the plain text part of this text module, or null if the MIME type is MIME_TYPE_HTML_TEXT.

Returns the plain text part of this text module, or null if the MIME type is MIME_TYPE_HTML_TEXT.

  • return: the plain text part of this text module, if any.
  • access: public
string getPlainTextContent ()
updateHtmlTextContent (line 140)

Updates the HTML text part of this text module.

Updates the HTML text part of this text module. The text module will not be updated on the server until commitUpdate() has been called.

  • access: public
void updateHtmlTextContent (string $sHtmlTextContent)
  • string $sHtmlTextContent: the new HTML text part.
updateName (line 106)

Updates the name of the text module.

Updates the name of the text module. The text module will not be updated on the server until commitUpdate() has been called.

  • access: public
void updateName (string $sName)
  • string $sName: the new text module name.
updatePlainTextContent (line 155)

Updates the plain text part of the text module.

Updates the plain text part of the text module. The text module will not be updated on the server until commitUpdate() has been called.

  • access: public
void updatePlainTextContent (string $sPlainTextContent)
  • string $sPlainTextContent: the new plain text part.

Inherited Methods

Inherited From Inx_Api_BusinessObject

Inx_Api_BusinessObject::commitUpdate()
Inx_Api_BusinessObject::getId()
Inx_Api_BusinessObject::reload()
Class Constants
ATTRIBUTE_HTML_TEXT = 2 (line 81)

Constant for the HTML text attribute.

Constant for the HTML text attribute.

ATTRIBUTE_LIST_CONTEXT_ID = 3 (line 86)

Constant for the list context id attribute.

Constant for the list context id attribute.

ATTRIBUTE_MIME_TYPE = 4 (line 91)

Constant for the MIME type attribute.

Constant for the MIME type attribute.

ATTRIBUTE_NAME = 0 (line 71)

Constant for the name attribute.

Constant for the name attribute. Used for ordering by the Inx_Api_TextModule_TextModuleManager.

  • see: Inx_Api_TextModule_TextModuleManager::select($oListContext, $iOrderAttribute, $iOrderType)
ATTRIBUTE_PLAIN_TEXT = 1 (line 76)

Constant for the plain text attribute.

Constant for the plain text attribute.

MIME_TYPE_HTML_TEXT = 0 (line 54)

MIME type constant for HTML text modules.

MIME type constant for HTML text modules. This text module has only a HTML text part.

MIME_TYPE_MULTIPART = 2 (line 64)

MIME type constant for multipart text modules.

MIME type constant for multipart text modules. This text module has a HTML and a plain text part.

MIME_TYPE_PLAIN_TEXT = 1 (line 59)

MIME type constant for plain text modules.

MIME type constant for plain text modules. This text module has only a plain text part.

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