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.
Located in /Api/TextModule/TextModule.php (line 48)
Inx_Api_BusinessObject | --Inx_Api_TextModule_TextModule
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.
Returns the id of the list which this text module belongs to.
Returns the id of the list which this text module belongs to.
Returns the MIME type of this text module.
Returns the MIME type of this text module. May be one of:
Returns the name of this text module.
Returns the name of this text module.
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.
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.
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.
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.
Inherited From Inx_Api_BusinessObject
Inx_Api_BusinessObject::commitUpdate()
Inx_Api_BusinessObject::getId()
Inx_Api_BusinessObject::reload()
Constant for the HTML text attribute.
Constant for the HTML text attribute.
Constant for the list context id attribute.
Constant for the list context id attribute.
Constant for the MIME type attribute.
Constant for the MIME type attribute.
Constant for the name attribute.
Constant for the name attribute. Used for ordering by the Inx_Api_TextModule_TextModuleManager.
Constant for the plain text attribute.
Constant for the plain text attribute.
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 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 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