Interface Inx_Api_Rendering_GeneralMailingRenderer

Description

The Inx_Api_Rendering_GeneralMailingRenderer is used to generate mail content of the following mailing types using the API:

  1. Regular mailing
  2. Action mailing
  3. Time trigger mailing
  4. Subscription trigger mailing
  5. Split test mailing
  6. Sequence mailing
The main use of the class will be to generate personalized previews of mailings. mailings that can be sent using a different mail sender. decrease enormously.

The Inx_Api_Rendering_GeneralMailingRenderer is used to generate mail content of the following mailing types using the API:

  1. Regular mailing
  2. Action mailing
  3. Time trigger mailing
  4. Subscription trigger mailing
  5. Split test mailing
  6. Sequence mailing
The main use of the class will be to generate personalized previews of mailings. The class can also be used to render mailings that can be sent using a different mail sender. Be aware that in this case the mail sending rate would decrease enormously. To preview a mailing, acquire a Inx_Api_Rendering_GeneralMailingRenderer from the Inx_Api_Rendering_GeneralMailingRenderer. Each mailing needs to be parsed before building it. The following snippet shows how to build a mail for a given recipient:
 $oRenderer = $oSession->getGeneralMailingManager()->createRenderer();
 $oRenderer->parse( $oMailing->getId(), Inx_Api_Rendering_BuildMode::NORMAL() );
 $oContent = $oRenderer->build( $iRecipientId );

Inx_Api_Rendering_GeneralMailingRenderer can handle the following different build modes:

  1. Inx_Api_Rendering_BuildMode::PREVIEW()
  2. Inx_Api_Rendering_BuildMode::ALTERNATIVEVIEW_ACTIVE()
  3. Inx_Api_Rendering_BuildMode::ALTERNATIVEVIEW_INACTIVE()
  4. Inx_Api_Rendering_BuildMode::NORMAL()
  5. Inx_Api_Rendering_BuildMode::ARCHIVE()
  6. Inx_Api_Rendering_BuildMode::ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS()
  7. Inx_Api_Rendering_BuildMode::NEWSLETTER_SIMPLE_LINKS()

Note: A Inx_Api_Rendering_GeneralMailingRenderer object must be closed once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.

Located in /Api/Rendering/GeneralMailingRenderer.php (line 52)


	
			
Method Summary
Inx_Api_Rendering_Content build (int $iRecipientId, [Inx_Api_Rendering_ContentType $preferredContentType = null])
void close ()
void parse (int $iMailingId, Inx_Api_Rendering_BuildMode $buildMode, [int $iSendingId = null])
Methods
build (line 98)

Generates the personalized mail content (recipient address, subject, HTML and/or plain text, . parsed mailing for the specified recipient and in the specified content type. If the recipient ID -2 is provided, a non existing recipient is used with the email address

Generates the personalized mail content (recipient address, subject, HTML and/or plain text, ...) of the last parsed mailing for the specified recipient and in the specified content type.
If the recipient ID -2 is provided, a non existing recipient is used with the email address "unknown@unknown.invalid", the ID 0 and no other attribute set.

  • return: the personalized content of the mail.
  • throws: Inx_Api_Rendering_BuildException if the recipient could not be found, or the building failed.
  • throws: Inx_Api_IllegalStateException if no mailing has been parsed yet or if the last parsing was unsuccessful.
  • throws: Inx_Api_IllegalArgumentException if $preferredContentType is invalid.
  • access: public
Inx_Api_Rendering_Content build (int $iRecipientId, [Inx_Api_Rendering_ContentType $preferredContentType = null])
  • int $iRecipientId: the ID of the recipient for which the mail shall be personalized.
  • Inx_Api_Rendering_ContentType $preferredContentType: the content type that should be used for building the mailing. If it is not supported by the mailing, the default content type of the mailing will be used i.e. the format of the mailing. May be omitted in which case the system default - which is equivalent to the mailing format - will be used.
close (line 105)

Closes this Inx_Api_Rendering_GeneralMailingRenderer and releases any server resources associated with this object. needed anymore to prevent memory leaks and other potentially harmful side effects.

Closes this Inx_Api_Rendering_GeneralMailingRenderer and releases any server resources associated with this object. An Inx_Api_Rendering_GeneralMailingRenderer object must be closed once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.

  • access: public
void close ()
parse (line 79)

Prepares the mailing for a preview of a specific sending.

Prepares the mailing for a preview of a specific sending. It checks the mail integrity (syntax errors, references to orphaned elements, ... ).
Errors will be listed in the Inx_Api_Rendering_ParseException The mailing ID and sending ID are supposed to be valid (existing mailing and sending). The following rules apply to the value of the sending ID parameter:

  • If the value is -1 or omitted, the mailing is parsed without sending specific information or content.
  • If the value refers to a non existing sending, an Inx_Api_APIException will be thrown.
  • If the value refers to a sending which is not applicable (e.g. a sending of a different mailing than the one specified by the mailing ID parameter), an Inx_Api_APIException will be thrown.

  • throws: Inx_Api_Rendering_ParseException if any syntax error is present in the mail.
  • throws: Inx_Api_APIException if the mailing ID or the sending ID are no longer valid, or the sending is not applicable.
  • throws: Inx_Api_IllegalArgumentException if the build mode is not valid.
  • access: public
void parse (int $iMailingId, Inx_Api_Rendering_BuildMode $buildMode, [int $iSendingId = null])
  • int $iMailingId: the ID of the mailing to be parsed.
  • Inx_Api_Rendering_BuildMode $buildMode: the mode of the build. Inx_Api_Rendering_BuildMode::UNKNOWN() is not allowed.
  • int $iSendingId: the ID of the sending, may be omitted.

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