Class Mage_Core_Model_Email_Template

Description

Template model

Example:

// Loading of template $emailTemplate = Mage::getModel('core/email_template') ->load(Mage::getStoreConfig('path_to_email_template_id_config')); $variables = array( 'someObject' => Mage::getSingleton('some_model') 'someString' => 'Some string value' ); $emailTemplate->send('some@domain.com', 'Name Of User', $variables);

Located in /Core/Model/Email/Template.php (line 45)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Core_Model_Template
         |
         --Mage_Core_Model_Email_Template
Direct descendents
Class Description
Mage_Adminhtml_Model_Email_Template Adminhtml email template model
Mage_Sales_Model_Email_Template Magento
Class Constant Summary
XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email'
XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path'
XML_PATH_TEMPLATE_EMAIL = 'global/template/email'
Variable Summary
Method Summary
static array getDefaultTemplates ()
void addBcc ( $bcc)
void getId ()
string getInclude (string $template,  $variables)
Zend_Mail getMail ()
string getProcessedTemplate ([ $variables = array()])
string getProcessedTemplateSubject ( $variables)
int|string getType ()
array getVariablesOptionArray ([boolean $withGroup = false])
boolean isValidForSend ()
Mage_Core_Model_Email_Template loadByCode (string $templateCode)
void loadDefault (string $templateId, [string $locale = null])
boolean send (array|string $email, [array|string|null $name = null], [ $variables = array()])
Mage_Core_Model_Email_Template sendTransactional (int $templateId, string|array $sender, string $email, string $name, [array $vars = array()], [int|null $storeId = null])
void setId (int $value)
void _construct ()
array _parseVariablesString (string $variablesString)
Variables
Methods
static method getDefaultTemplates (line 173)

Retrive default templates from config

  • access: public
static array getDefaultTemplates ()
static method getDefaultTemplatesAsOptionsArray (line 187)

Retrive default templates as options array

  • access: public
static array getDefaultTemplatesAsOptionsArray ()
addBcc (line 469)
  • access: public
void addBcc ( $bcc)
  • $bcc
getId (line 214)

Return template id

return int|null

  • access: public
void getId ()

Redefinition of:
Mage_Core_Model_Abstract::getId()
Retrieve model object identifier
getInclude (line 307)

Get template code for include directive

  • access: public
string getInclude (string $template,  $variables)
  • string $template
  • array $variables

Redefined in descendants as:
getMail (line 75)

Retrieve mail object instance

  • access: public
Zend_Mail getMail ()
getPreparedTemplateText (line 290)

Makes additional text preparations for HTML templates

  • access: public
string getPreparedTemplateText ()
getProcessedTemplate (line 256)

Process email template code

  • access: public
string getProcessedTemplate ([ $variables = array()])
  • array $variables
getProcessedTemplateSubject (line 447)

Process email subject

  • access: public
string getProcessedTemplateSubject ( $variables)
  • array $variables
getTemplateFilter (line 100)

Get filter object for template processing logi

  • access: public
getType (line 246)

Getter for template type

  • access: public
int|string getType ()

Redefinition of:
Mage_Core_Model_Template::getType()
Getter for template type
getVariablesOptionArray (line 528)

Retrieve option array of variables

  • access: public
array getVariablesOptionArray ([boolean $withGroup = false])
  • boolean $withGroup: if true wrap variable options in group
isValidForSend (line 233)

Return true if this template can be used for sending queue as main template

  • access: public
boolean isValidForSend ()
loadByCode (line 116)

Load template by code

  • access: public
Mage_Core_Model_Email_Template loadByCode (string $templateCode)
  • string $templateCode
loadDefault (line 128)

Load default email template from locale translate

  • access: public
void loadDefault (string $templateId, [string $locale = null])
  • string $templateId
  • string $locale
send (line 325)

Send mail to recipient

  • access: public
boolean send (array|string $email, [array|string|null $name = null], [ $variables = array()])
  • array|string $email: E-mail(s)
  • array|string|null $name: receiver name(s)
  • array $variables: template variables
sendTransactional (line 407)

Send transactional email to recipient

  • access: public
Mage_Core_Model_Email_Template sendTransactional (int $templateId, string|array $sender, string $email, string $name, [array $vars = array()], [int|null $storeId = null])
  • int $templateId
  • string|array $sender: sneder informatio, can be declared as part of config path
  • string $email: recipient email
  • string $name: recipient name
  • array $vars: varianles which can be used in template
  • int|null $storeId
setId (line 223)

Set id of template

  • access: public
void setId (int $value)
  • int $value

Redefinition of:
Mage_Core_Model_Abstract::setId()
Declare model object identifier value
setReplyTo (line 500)

Add Reply-To header

  • access: public
Mage_Core_Model_Email_Template setReplyTo (string $email)
  • string $email
setReturnPath (line 488)

Set Return Path

  • access: public
Mage_Core_Model_Email_Template setReturnPath (string $email)
  • string $email
setTemplateFilter (line 89)

Declare template processing filter

  • access: public
Mage_Core_Model_Email_Template setTemplateFilter ( $filter)
  • Varien_Filter_Template $filter
_beforeSave (line 554)

Validate email template code

  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::_beforeSave()
Processing object before save data
_construct (line 65)

Initialize email template model

  • access: protected
void _construct ()
_parseVariablesString (line 512)

Parse variables string into array of variables

  • access: protected
array _parseVariablesString (string $variablesString)
  • string $variablesString

Inherited Methods

Inherited From Mage_Core_Model_Template

Mage_Core_Model_Template::emulateDesign()
Mage_Core_Model_Template::getDesignConfig()
Mage_Core_Model_Template::getType()
Mage_Core_Model_Template::isPlain()
Mage_Core_Model_Template::revertDesign()
Mage_Core_Model_Template::setDesignConfig()
Mage_Core_Model_Template::_applyDesignConfig()
Mage_Core_Model_Template::_cancelDesignConfig()

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterCommitCallback()
Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::cleanModelCache()
Mage_Core_Model_Abstract::clearInstance()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCacheIdTags()
Mage_Core_Model_Abstract::getCacheTags()
Mage_Core_Model_Abstract::getCollection()
Mage_Core_Model_Abstract::getEntityId()
Mage_Core_Model_Abstract::getId()
Mage_Core_Model_Abstract::getIdFieldName()
Mage_Core_Model_Abstract::getResource()
Mage_Core_Model_Abstract::getResourceCollection()
Mage_Core_Model_Abstract::getResourceName()
Mage_Core_Model_Abstract::isObjectNew()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterDeleteCommit()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_afterSaveCommit()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeLoad()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_clearData()
Mage_Core_Model_Abstract::_clearReferences()
Mage_Core_Model_Abstract::_getEventData()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_hasModelChanged()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email' (line 53)
XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path' (line 52)
XML_PATH_TEMPLATE_EMAIL = 'global/template/email' (line 51)

Configuration path for default email templates

Inherited Constants

Inherited from Mage_Core_Model_Template

Mage_Core_Model_Template::DEFAULT_DESIGN_AREA
Mage_Core_Model_Template::TYPE_HTML
Mage_Core_Model_Template::TYPE_TEXT

Documentation generated on Fri, 11 Feb 2011 17:14:29 +0200 by phpDocumentor 1.4.3