Interface Inx_Api_Mail_MailingRenderer

Description

The Inx_Api_Mail_MailingRenderer is used to generate mail content using the API.

The Inx_Api_Mail_MailingRenderer is used to generate mail content using the API. The main use of the class will be to generate personalized previews of mailings. The class can also be used to generate and send single mails using a different mail sender. Be aware that in this case the mail sending rate would decrease enormously. To preview a mailing, acquire an Inx_Api_Mail_MailingRenderer from the Inx_Api_Mailing_MailingManager. Each mailing needs to be parsed before building it. The following snippet shows how to build a mail for a given recipient:

 $oMailingRenderer = $oSession->getMailingManager()->createRenderer();
 $oMailingRenderer->parse( $oMailing->getId(), Inx_Api_Mail_MailingRenderer::BUILD_MODE_ALTERNATIVEVIEW_ACTIVE );
 $oMailContent = $oMailingRenderer->build( $iRecipientId );

Inx_Api_Mail_MailingRenderer can handle the following different build modes:

  1. BUILD_MODE_PREVIEW - Trackable links will not trigger any events, unsubscription links will redirect but not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
  2. BUILD_MODE_VIEW - deprecated, should not longer be used.
  3. BUILD_MODE_ALTERNATIVEVIEW_ACTIVE - All links are fully functional. Embedded images are replaced with http references to image resources on the Inxmail server.
  4. BUILD_MODE_ALTERNATIVEVIEW_INACTIVE - All links are not functional. Embedded images are replaced with http references to image resources on the Inxmail server.
  5. BUILD_MODE_NORMAL - The mail is rendered, ready to be sent.
  6. BUILD_MODE_ARCHIVE - Trackable links will not trigger any events, unsubscription links will redirect but not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server.
  7. BUILD_MODE_ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS - All links are fully functional but converted to simple links. Embedded images are replaced with http references to image resources on the Inxmail server.
  8. BUILD_MODE_NEWSLETTER_SIMPLE_LINKS - The same as above, but the function InInboxView returns true.

<strong>Note:</strong> An Inx_Api_Mail_MailingRenderer object <strong>must</strong> be closed once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.

  • version: $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
  • see: Inx_Api_Mail_MailContent
  • deprecated: As of 1.11.10, Inx_Api_Mail_MailingRenderer has been replaced with Inx_Api_Rendering_GeneralMailingRenderer
  • since: API 1.0

Located in /Api/Mail/MailingRenderer.php (line 50)


	
			
Class Constant Summary
Method Summary
Inx_Api_Mail_MailContent build (int $iRecipientId, [int $iPreferredMailType = null])
void close ()
void parse (int $iMailingId, int $iBuildMode)
Methods
build (line 126)

Generates the personalized mail content (recipient address, subject, HTML and/or plain text, . specified recipient with a specified mail type restriction.

Generates the personalized mail content (recipient address, subject, HTML and/or plain text, ...) for the specified recipient with a specified mail type restriction.

  • return: the personalized content of the mail.
  • throws: Inx_Api_Mail_BuildException if the recipient could not be found, or the building failed.
  • access: public
Inx_Api_Mail_MailContent build (int $iRecipientId, [int $iPreferredMailType = null])
  • int $iRecipientId: the id of the recipient for which the mail shall be personalized.
  • int $iPreferredMailType: the mail type. May be one of:
    • Inx_Api_Mail_MailContent::MAIL_TYPE_HTML_TEXT
    • Inx_Api_Mail_MailContent::MAIL_TYPE_PLAIN_TEXT
    • Inx_Api_Mail_MailContent::MAIL_TYPE_MULTIPART
    May be ommitted (defaults to the standard mail type).
close (line 133)

Closes this Inx_Api_Mail_MailingRenderer and releases any server resources associated with this object.

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

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

Prepares the mailing for a preview.

Prepares the mailing for a preview. It checks the mail integrity (syntax errors, references to orphaned elements, ... ).
Errors will be listed in the Inx_Api_Mail_ParseException.
The mailingId is supposed to be valid (existing mailing).

  • throws: Inx_Api_APIException if the mailing id is no longer valid.
  • throws: Inx_Api_Mail_ParseException if any syntax error is present in the mail.
  • access: public
void parse (int $iMailingId, int $iBuildMode)
  • int $iMailingId: the id of the mailing to be parsed.
  • int $iBuildMode: the mode of the build. May be one of the constants defined in this class:
    • BUILD_MODE_NORMAL
    • BUILD_MODE_ALTERNATIVEVIEW_ACTIVE
    • BUILD_MODE_ALTERNATIVEVIEW_INACTIVE
    • BUILD_MODE_PREVIEW
    • BUILD_MODE_ARCHIVE
    • BUILD_MODE_ALTERNATIVEVIEW_ACTIVE_SIMPLE_LINKS
    • BUILD_MODE_NEWSLETTER_SIMPLE_LINKS
Class Constants
BUILD_MODE_ALTERNATIVEVIEW_ACTIVE = 101 (line 64)

Mode for alternative view. image resources on the Inxmail server.

Mode for alternative view. All links are fully functional. Embedded images are replaced with http references to image resources on the Inxmail server.

BUILD_MODE_ALTERNATIVEVIEW_INACTIVE = 104 (line 71)

Mode for alternative view. any event or generate any click. Inxmail server.

Mode for alternative view. Standard links are not functional, tracking links are functional but will not trigger any event or generate any click. Embedded images are replaced with http references to image resources on the Inxmail server.

BUILD_MODE_ARCHIVE = 103 (line 87)

Mode for archive view. any event or generate any click, unsubscription links will redirect but not unsubscribe anybody. are replaced with http references to image resources on the Inxmail server. return true while building the mailing.

Mode for archive view. Standard links are fully functional, tracking links are functional but will not trigger any event or generate any click, unsubscription links will redirect but not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server. The function InInboxView() will return true while building the mailing.

BUILD_MODE_NORMAL = 100 (line 53)

Mode to generate a normal mail, ready to be sent.

Mode to generate a normal mail, ready to be sent.

BUILD_MODE_PREVIEW = 102 (line 79)

Mode for mail preview. any event or generate any click, unsubscription links will redirect but not unsubscribe anybody. are replaced with http references to image resources on the Inxmail server. return true while building the mailing.

Mode for mail preview. Standard links are fully functional, tracking links are functional but will not trigger any event or generate any click, unsubscription links will redirect but not unsubscribe anybody. Embedded images are replaced with http references to image resources on the Inxmail server. The function InInboxView() will return true while building the mailing.

BUILD_MODE_VIEW = 101 (line 58)
  • deprecated: use BUILD_MODE_ALTERNATIVEVIEW_ACTIVE instead.

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