.

AlternativeMessageBuilder Class Reference

Build message body for a single and an alternative message. More...

Inheritance diagram for AlternativeMessageBuilder:
AttachmentsBuilder IMailMessageBuilder

List of all members.

Public Member Functions

  __construct ($msg, $mime, $alt)
  Constructors.
  get_body ()
  Return mail body.
  get_mail_mime ()
  Return mime type of mail as a whole.

Protected Attributes

  $alt_message

Detailed Description

Build message body for a single and an alternative message.

Definition at line 8 of file alternativemessages.builder.php.


Constructor & Destructor Documentation

AlternativeMessageBuilder::__construct ( msg,
mime,
alt  
)

Constructors.

Parameters:
string  $msg Message body
string  $mime Mime type
string  $alt Alternative message

Definition at line 23 of file alternativemessages.builder.php.

00023                                                        {
00024                 parent::__construct(new SingleMessageBuilder($msg, $mime), array());
00025                 $this->alt_message = $alt;
00026         }

Member Function Documentation

AlternativeMessageBuilder::get_body (  ) 

Return mail body.

Returns:
string

Reimplemented from AttachmentsBuilder.

Definition at line 42 of file alternativemessages.builder.php.

00042                                    {
00043                 $blocks = array();
00044                 $altbuilder = new SingleMessageBuilder($this->alt_message, MailMessage::MIME_TEXT_PLAIN);
00045                 $blocks[] = $this->create_block(
00046                         $altbuilder->get_mail_mime(), false, $altbuilder->get_body(), $altbuilder->get_additional_headers()
00047                 );
00048                 $blocks[] = $this->create_block(
00049                         $this->message_builder->get_mail_mime(), false, $this->message_builder->get_body(), $this->message_builder->get_additional_headers()
00050                 );
00051                 return 
00052                         $this->start_seperator($this->boundary) .
00053                         implode("\n" . $this->start_seperator($this->boundary), $blocks) .
00054                         $this->end_seperator($this->boundary);
00055         }       
AlternativeMessageBuilder::get_mail_mime (  ) 

Return mime type of mail as a whole.

Returns:
string

Reimplemented from AttachmentsBuilder.

Definition at line 33 of file alternativemessages.builder.php.

00033                                         {
00034                 return 'multipart/alternative; boundary=' . $this->get_boundary();
00035         }

Member Data Documentation

AlternativeMessageBuilder::$alt_message [protected]

Definition at line 14 of file alternativemessages.builder.php.


The documentation for this class was generated from the following file: