api.zedseries.com
[ class tree: TemplateMailer ] [ index: TemplateMailer ] [ all elements ]

Class: ZedSeriesTemplateMailer

Source Location: /ZedSeriesTemplateMailer.php

Class ZedSeriesTemplateMailer

Class Overview

Class ZedSeriesTemplateMailer

Allow to send customized template-based email messages

QuickStart example:

  1. <?php
  2. $templateFile 'my_template'# same behaviour as Module (and BackendModule) 
  3. $data         array('fullname' => 'John Doe')
  4. $email new ZedSeriesTemplateMailer();
  5. $email->loadTemplate($templateFile$data);
  6. $email->from sender@example.com
  7. $email->sendTo('recipient@example.com');
  8. ?>

if my_template.tpl's content is:

  1. welcome
  2. Dear ##fullname##,
  3.   Here is how ZedSeriesTemplateMailer works

the first line of the template will be treated as subject, (i.e. the subject will be welcome)

Will be sent the following email to recipient@example.com:

  1. Dear John Doe,
  2.   Here is how ZedSeriesTemplateMailer works

You can use insertTags too when writing template

Located in /ZedSeriesTemplateMailer.php [line 41]

Email
   |
   --ZedSeriesTemplateMailer
Author(s): Information Tags:
Copyright:  Angelo Galleja 2008,2009,2010
Extends:  Email

Properties

Methods

[ Top ]
Property Summary
mixed   $_substTable  
mixed   $_tpl  
mixed   $_utils  

[ Top ]
Method Summary
void   loadTemplate()   load a template file and replace all insertTags plus customData
void   setData()  

[ Top ]
Properties
mixed   $_substTable = array() [line 43]
API Tags:
Access:  protected


[ Top ]
mixed   $_tpl [line 43]
API Tags:
Access:  protected


[ Top ]
mixed   $_utils [line 43]
API Tags:
Access:  protected


[ Top ]
Methods
loadTemplate  [line 60]

  void loadTemplate( string $template, array $data  )

load a template file and replace all insertTags plus customData

Parameters:
string   $template:  file to use as template.
you must specify it without extension (as you normally do in Module development)
the template can contain insertTags (see TYPOlight documentation for a list of insertTags) and customData enclosed by '##'
the first line of template will be used as subject
array   $data:  an associative array of custom data to replace
the $data's keys will be replaced with the $data's values

API Tags:
Access:  public


[ Top ]
setData  [line 72]

  void setData( $data  )

Parameters:
   $data: 

API Tags:
Access:  protected

Information Tags:
Private:  

[ Top ]

Documentation generated on Fri, 22 Oct 2010 17:37:28 +0200 by phpDocumentor 1.4.1