Mage_Adminhtml_Model_Email_Template
extends Mage_Core_Model_Email_Template
in package
Template model
Table of Contents
Constants
- DEFAULT_DESIGN_AREA : mixed = \Mage_Core_Model_App_Area::AREA_FRONTEND
- Default design area for emulation
- TYPE_HTML : mixed = 2
- TYPE_TEXT : mixed = 1
- Types of template
- XML_PATH_CSS_NON_INLINE_FILES : mixed = 'design/email/css_non_inline'
- XML_PATH_DESIGN_EMAIL_LOGO : mixed = 'design/email/logo'
- XML_PATH_DESIGN_EMAIL_LOGO_ALT : mixed = 'design/email/logo_alt'
- XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT : mixed = 'design/email/logo_height'
- XML_PATH_DESIGN_EMAIL_LOGO_WIDTH : mixed = 'design/email/logo_width'
- XML_PATH_SENDING_RETURN_PATH_EMAIL : mixed = 'system/smtp/return_path_email'
- XML_PATH_SENDING_SET_RETURN_PATH : mixed = 'system/smtp/set_return_path'
- XML_PATH_TEMPLATE_EMAIL : mixed = '//sections/*/groups/*/fields/*[source_model="a...
- Xml path to email template nodes
Properties
- $_attachments : array<string|int, Mage_Core_Model_Email_Attachment>
- $_bccEmails : mixed
- $_cacheTag : string|bool|array<string|int, mixed>
- Model cache tag for clear cache in after save and after delete
- $_cssFileCache : mixed
- $_data : array<string|int, mixed>|null
- Object attributes
- $_dataSaveAllowed : bool
- Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
- $_defaultTemplates : mixed
- $_designConfig : DataObject|null
- Configuration of design package for template
- $_dirty : array<string|int, mixed>
- $_emulatedDesignConfig : DataObject|false
- Configuration of emulated design package.
- $_eventObject : string
- Parameter name in event
- $_eventPrefix : string
- Prefix of model events names
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_initialEnvironmentInfo : DataObject|null
- Initial environment information
- $_isDeleted : bool
- Object delete flag
- $_isObjectNew : bool|null
- Flag which allow detect object state: is it new object (without id) or existing one (with id)
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_preprocessFlag : mixed
- $_replyToEmail : string|null
- $_resource : Mage_Core_Model_Resource_Db_Abstract
- Resource model instance
- $_resourceCollectionName : string
- Name of the resource collection model
- $_resourceName : string
- Name of the resource model
- $_returnPathEmail : string|null
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_templateFilter : mixed
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
Methods
- __call() : mixed
- Set/Get attribute wrapper
- __construct() : mixed
- Constructor
- __get() : mixed
- Attribute getter (deprecated)
- __set() : mixed
- Attribute setter (deprecated)
- __toArray() : array<string|int, mixed>
- Convert object attributes to array
- _getResource() : Mage_Core_Model_Resource_Email_Template
- Get resource instance
- addBcc() : $this
- addData() : $this
- Add data to the object.
- afterCommitCallback() : $this
- Callback function which called after transaction commit in resource model
- afterLoad() : $this
- Object after load processing. Implemented as public interface for supporting objects after load in collections
- cleanModelCache() : $this
- Remove model object related cache
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- dataHasChangedFor() : bool
- Compare object data with original data
- debug() : string|array<string|int, mixed>
- Present object data as string in debug mode
- delete() : $this
- Delete object from database
- emulateDesign() : mixed
- Save current design config and replace with design config from specified store Event is not dispatched.
- flagDirty() : $this
- getAddedAt() : string
- getAttachments() : array<string|int, Mage_Core_Model_Email_Attachment>
- getBillingAddress() : Mage_Customer_Model_Address_Abstract
- getCacheIdTags() : array<string|int, mixed>|false
- Get cache tags associated with object id
- getCacheTags() : array<string|int, mixed>|false
- Get list of cache tags applied to model object.
- getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
- getCreatedAt() : string
- getData() : mixed
- Object data getter
- getDataByKey() : mixed
- Get object data by particular key
- getDataByPath() : mixed
- Get object data by path
- getDataSetDefault() : mixed
- Fast get data or set default if value is not available
- getDataUsingMethod() : mixed
- Get object data by key with calling getter method
- getDefaultTemplates() : array<string|int, mixed>
- Retrieve default templates from config
- getDefaultTemplatesAsOptionsArray() : array<string|int, mixed>
- Retrieve default templates as options array
- getEntityId() : int
- getId() : int|string|null
- Return template id return int|null
- getIdFieldName() : string
- Retrieve identifier field name for model
- getInclude() : string
- Get template code for include directive
- getInlineCssFile() : string
- getModifiedAt() : string
- getOrigData() : mixed
- Get object loaded data (original data)
- getOrigTemplateCode() : string
- getOrigTemplateVariables() : string
- getPreparedTemplateText() : string
- getProcessedTemplate() : string
- Process email template code
- getProcessedTemplateSubject() : string
- Process email subject
- getQueue() : Mage_Core_Model_Email_Queue
- getQueueName() : string|null
- getResource() : Mage_Core_Model_Resource_Email_Template
- Retrieve model resource
- getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getSenderEmail() : string
- getSenderName() : string
- getSentSuccess() : bool
- getShippingAddress() : Mage_Customer_Model_Address_Abstract
- getSystemConfigPathsWhereUsedAsDefault() : array<string|int, mixed>
- Collect all system config paths where current template is used as default
- getSystemConfigPathsWhereUsedCurrently() : array<string|int, mixed>
- Collect all system config paths where current template is currently used
- getTemplateActual() : int
- getTemplateByConfigPath() : string
- Get template code for template directive
- getTemplateCode() : string
- getTemplateFilter() : Mage_Core_Model_Email_Template_Filter
- Get filter object for template processing logi
- getTemplateId() : int
- getTemplateSenderEmail() : string
- getTemplateSenderName() : string
- getTemplateStyles() : string
- getTemplateSubject() : string
- getTemplateText() : string
- getTemplateType() : int
- getType() : int|string
- Getter for template type
- getUseAbsoluteLinks() : bool
- getVariablesOptionArray() : array<string|int, mixed>
- Retrieve option array of variables
- hasData() : bool
- If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
- hasDataChanges() : bool
- Get data change status
- hasErrors() : bool
- hasQueue() : int
- isDeleted() : bool
- Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
- isDirty() : bool
- isEmpty() : bool
- checks whether the object is empty
- isModuleEnabled() : bool
- isObjectNew() : bool
- Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
- isPlain() : bool
- Return true if template type eq text
- isValidForSend() : bool
- Return true if this template can be used for sending queue as main template
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadByCode() : $this
- Load template by code
- loadByConfigPath() : $this|null
- Load template by configuration path. This enables html templates to include other html templates by their system configuration XPATH value
- loadDefault() : $this
- Load default email template from locale translate
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- revertDesign() : mixed
- Revert to last design config, used before emulation
- save() : $this
- Save object data
- send() : bool
- Send mail to recipient
- sendTransactional() : $this
- Send transactional email to recipient
- serialize() : string
- serialize object attributes
- setAddedAt() : $this
- setAttachments() : $this
- Set the attachments to add to the email
- setAttribute() : $this
- setCreatedAt() : $this
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setDesignConfig() : $this
- Initialize design information for template processing
- setId() : $this
- Set id of template
- setIdFieldName() : $this
- set name of object id field
- setInlineCssFile() : $this
- setModifiedAt() : $this
- setOrigData() : $this
- Initialize object original data
- setOrigTemplateCode() : $this
- setOrigTemplateVariables() : $this
- setQueue() : $this
- setQueueName() : $this
- setReplyTo() : $this
- Add Reply-To header
- setReturnPath() : $this
- Set Return Path
- setSenderEmail() : $this
- setSenderName() : $this
- setSentSuccess() : $this
- setTemplateCode() : $this
- setTemplateFilter() : $this
- Declare template processing filter
- setTemplateId() : $this
- setTemplateSenderEmail() : $this
- setTemplateSenderName() : $this
- setTemplateStyles() : $this
- setTemplateSubject() : $this
- setTemplateText() : $this
- setTemplateType() : $this
- setUpdatedAt() : $this
- setUseAbsoluteLinks() : void
- toArray() : array<string|int, mixed>
- Public wrapper for __toArray
- toJson() : string
- Public wrapper for __toJson
- toString() : string
- Public wrapper for __toString
- toXml() : string
- Public wrapper for __toXml
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addEmailVariables() : array<string|int, mixed>
- Add variables that are used by transactional emails and newsletter emails
- _addFullNames() : mixed
- _afterDelete() : $this
- Delete current usage
- _afterDeleteCommit() : $this
- Processing manipulation after main transaction commit
- _afterLoad() : $this
- Processing object after load data
- _afterSave() : $this
- Processing object after save data
- _applyDesignConfig() : $this
- Applying of design config
- _applyInlineCss() : string
- Merge HTML and CSS and returns HTML that has CSS styles applied "inline" to the HTML tags. This is necessary in order to support all email clients.
- _beforeDelete() : $this
- Processing object before delete data
- _beforeLoad() : $this
- Processing object before load data
- _beforeSave() : $this
- Validate email template code
- _camelize() : string
- _cancelDesignConfig() : $this
- Revert design settings to previous
- _clearData() : $this
- Clearing object's data
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Internal constructor not depended on params. Can be used for object initialization
- _getCssByConfig() : string
- Accepts a path to a System Config setting that contains a comma-delimited list of files to load. Loads those files and then returns the concatenated content.
- _getCssFileContent() : string
- Load CSS content from filesystem
- _getData() : mixed
- Get value from _data array without parse key
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _getLogoAlt() : string
- Return logo alt for emails
- _getLogoUrl() : string
- Return logo URL for emails Take logo from skin if custom logo is undefined
- _getNonInlineCssTag() : string
- Loads content of files with non-inline CSS styles and merges them with any CSS styles that are specified within the <!--@styles @--> comments or in the Transactional Emails
- _hasModelChanged() : bool
- Check whether model has changed data.
- _init() : mixed
- Standard model initialization
- _initOldFieldsMap() : mixed
- Inits mapping array of object's previously used fields to new fields.
- _parseVariablesString() : array<string|int, mixed>
- Parse variables string into array of variables
- _prepareArray() : array<string|int, mixed>
- Set required array elements
- _prepareSyncFieldsMap() : $this
- Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
- _protectFromNonAdmin() : mixed
- Safeguard func that will check, if we are in admin area
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
- getDesignConfig() : DataObject
- Get design configuration data
Constants
DEFAULT_DESIGN_AREA
Default design area for emulation
public
mixed
DEFAULT_DESIGN_AREA
= \Mage_Core_Model_App_Area::AREA_FRONTEND
TYPE_HTML
public
mixed
TYPE_HTML
= 2
TYPE_TEXT
Types of template
public
mixed
TYPE_TEXT
= 1
XML_PATH_CSS_NON_INLINE_FILES
public
mixed
XML_PATH_CSS_NON_INLINE_FILES
= 'design/email/css_non_inline'
XML_PATH_DESIGN_EMAIL_LOGO
public
mixed
XML_PATH_DESIGN_EMAIL_LOGO
= 'design/email/logo'
XML_PATH_DESIGN_EMAIL_LOGO_ALT
public
mixed
XML_PATH_DESIGN_EMAIL_LOGO_ALT
= 'design/email/logo_alt'
XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT
public
mixed
XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT
= 'design/email/logo_height'
XML_PATH_DESIGN_EMAIL_LOGO_WIDTH
public
mixed
XML_PATH_DESIGN_EMAIL_LOGO_WIDTH
= 'design/email/logo_width'
XML_PATH_SENDING_RETURN_PATH_EMAIL
public
mixed
XML_PATH_SENDING_RETURN_PATH_EMAIL
= 'system/smtp/return_path_email'
XML_PATH_SENDING_SET_RETURN_PATH
public
mixed
XML_PATH_SENDING_SET_RETURN_PATH
= 'system/smtp/set_return_path'
XML_PATH_TEMPLATE_EMAIL
Xml path to email template nodes
public
mixed
XML_PATH_TEMPLATE_EMAIL
= '//sections/*/groups/*/fields/*[source_model="adminhtml/system_config_source_email_template"]'
Properties
$_attachments
protected
array<string|int, Mage_Core_Model_Email_Attachment>
$_attachments
= []
$_bccEmails
protected
mixed
$_bccEmails
= []
$_cacheTag
Model cache tag for clear cache in after save and after delete
protected
string|bool|array<string|int, mixed>
$_cacheTag
= \false
When you use true - all cache will be clean
$_cssFileCache
protected
mixed
$_cssFileCache
= []
$_data
Object attributes
protected
array<string|int, mixed>|null
$_data
= []
$_dataSaveAllowed
Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
protected
bool
$_dataSaveAllowed
= \true
$_defaultTemplates
protected
static mixed
$_defaultTemplates
$_designConfig
Configuration of design package for template
protected
DataObject|null
$_designConfig
$_dirty
protected
array<string|int, mixed>
$_dirty
$_emulatedDesignConfig
Configuration of emulated design package.
protected
DataObject|false
$_emulatedDesignConfig
= \false
$_eventObject
Parameter name in event
protected
string
$_eventObject
= 'object'
In observe method you can use $observer->getEvent()->getObject() in this case
$_eventPrefix
Prefix of model events names
protected
string
$_eventPrefix
= 'core_abstract'
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_initialEnvironmentInfo
Initial environment information
protected
DataObject|null
$_initialEnvironmentInfo
= \null
Tags
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_isObjectNew
Flag which allow detect object state: is it new object (without id) or existing one (with id)
protected
bool|null
$_isObjectNew
= \null
$_oldFieldsMap
Map short fields names to its full names
protected
array<string|int, mixed>
$_oldFieldsMap
= []
$_origData
Original data that was loaded
protected
array<string|int, mixed>|null
$_origData
$_preprocessFlag
protected
mixed
$_preprocessFlag
= \false
$_replyToEmail
protected
string|null
$_replyToEmail
= \null
$_resource
Resource model instance
protected
Mage_Core_Model_Resource_Db_Abstract
$_resource
$_resourceCollectionName
Name of the resource collection model
protected
string
$_resourceCollectionName
$_resourceName
Name of the resource model
protected
string
$_resourceName
$_returnPathEmail
protected
string|null
$_returnPathEmail
= \null
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_templateFilter
protected
mixed
$_templateFilter
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
Methods
__call()
Set/Get attribute wrapper
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
Constructor
public
__construct() : mixed
By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes
__get()
Attribute getter (deprecated)
public
__get(string $var) : mixed
Parameters
- $var : string
__set()
Attribute setter (deprecated)
public
__set(string $var, mixed $value) : mixed
Parameters
- $var : string
- $value : mixed
__toArray()
Convert object attributes to array
public
__toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
array<string|int, mixed>_getResource()
Get resource instance
public
_getResource() : Mage_Core_Model_Resource_Email_Template
Return values
Mage_Core_Model_Resource_Email_TemplateaddBcc()
public
addBcc(array<string|int, mixed>|string $bcc) : $this
Parameters
- $bcc : array<string|int, mixed>|string
Return values
$thisaddData()
Add data to the object.
public
addData(array<string|int, mixed> $arr) : $this
Retains previous data in the object.
Parameters
- $arr : array<string|int, mixed>
Return values
$thisafterCommitCallback()
Callback function which called after transaction commit in resource model
public
afterCommitCallback() : $this
Return values
$thisafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thiscleanModelCache()
Remove model object related cache
public
cleanModelCache() : $this
Return values
$thisclearInstance()
Clearing object for correct deleting by garbage collector
public
final clearInstance() : $this
Return values
$thisdataHasChangedFor()
Compare object data with original data
public
dataHasChangedFor(string $field) : bool
Parameters
- $field : string
Return values
booldebug()
Present object data as string in debug mode
public
debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
- $data : mixed = null
- $objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>delete()
Delete object from database
public
delete() : $this
Tags
Return values
$thisemulateDesign()
Save current design config and replace with design config from specified store Event is not dispatched.
public
emulateDesign(int|string $storeId[, string $area = self::DEFAULT_DESIGN_AREA ]) : mixed
Parameters
- $storeId : int|string
- $area : string = self::DEFAULT_DESIGN_AREA
flagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisgetAddedAt()
public
getAddedAt() : string
Return values
stringgetAttachments()
public
getAttachments() : array<string|int, Mage_Core_Model_Email_Attachment>
Return values
array<string|int, Mage_Core_Model_Email_Attachment>getBillingAddress()
public
getBillingAddress() : Mage_Customer_Model_Address_Abstract
Return values
Mage_Customer_Model_Address_AbstractgetCacheIdTags()
Get cache tags associated with object id
public
getCacheIdTags() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetCacheTags()
Get list of cache tags applied to model object.
public
getCacheTags() : array<string|int, mixed>|false
Return false if cache tags are not supported by model
Return values
array<string|int, mixed>|falsegetCollection()
public
getCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract|false
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_Abstract|falsegetCreatedAt()
public
getCreatedAt() : string
Return values
stringgetData()
Object data getter
public
getData([string $key = '' ][, string|int $index = null ]) : mixed
If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data
If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.
Parameters
- $key : string = ''
- $index : string|int = null
getDataByKey()
Get object data by particular key
public
getDataByKey(string $key) : mixed
Parameters
- $key : string
getDataByPath()
Get object data by path
public
getDataByPath(string $path) : mixed
Method consider the path as chain of keys: a/b/c => ['a']['b']['c']
Parameters
- $path : string
getDataSetDefault()
Fast get data or set default if value is not available
public
getDataSetDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getDataUsingMethod()
Get object data by key with calling getter method
public
getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
- $key : string
- $args : mixed = null
getDefaultTemplates()
Retrieve default templates from config
public
static getDefaultTemplates() : array<string|int, mixed>
Return values
array<string|int, mixed>getDefaultTemplatesAsOptionsArray()
Retrieve default templates as options array
public
static getDefaultTemplatesAsOptionsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getEntityId()
public
getEntityId() : int
Return values
intgetId()
Return template id return int|null
public
getId() : int|string|null
Attributes
- #[Override]
Return values
int|string|nullgetIdFieldName()
Retrieve identifier field name for model
public
getIdFieldName() : string
Attributes
- #[Override]
Return values
stringgetInclude()
Get template code for include directive
public
getInclude(string $template, array<string|int, mixed> $variables) : string
Parameters
- $template : string
- $variables : array<string|int, mixed>
Return values
stringgetInlineCssFile()
public
getInlineCssFile() : string
Return values
stringgetModifiedAt()
public
getModifiedAt() : string
Return values
stringgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getOrigTemplateCode()
public
getOrigTemplateCode() : string
Return values
stringgetOrigTemplateVariables()
public
getOrigTemplateVariables() : string
Return values
stringgetPreparedTemplateText()
public
getPreparedTemplateText([string|null $html = null ]) : string
Parameters
- $html : string|null = null
Return values
stringgetProcessedTemplate()
Process email template code
public
getProcessedTemplate([array<string|int, mixed> $variables = [] ]) : string
Parameters
- $variables : array<string|int, mixed> = []
Return values
stringgetProcessedTemplateSubject()
Process email subject
public
getProcessedTemplateSubject(array<string|int, mixed> $variables) : string
Parameters
- $variables : array<string|int, mixed>
Return values
stringgetQueue()
public
getQueue() : Mage_Core_Model_Email_Queue
Return values
Mage_Core_Model_Email_QueuegetQueueName()
public
getQueueName() : string|null
Return values
string|nullgetResource()
Retrieve model resource
public
getResource() : Mage_Core_Model_Resource_Email_Template
Return values
Mage_Core_Model_Resource_Email_TemplategetResourceCollection()
Get collection instance
public
getResourceCollection() : Mage_Core_Model_Resource_Db_Collection_Abstract
Tags
Return values
Mage_Core_Model_Resource_Db_Collection_AbstractgetResourceName()
Retrieve model resource name
public
getResourceName() : string
Return values
stringgetSenderEmail()
public
getSenderEmail() : string
Return values
stringgetSenderName()
public
getSenderName() : string
Return values
stringgetSentSuccess()
public
getSentSuccess() : bool
Return values
boolgetShippingAddress()
public
getShippingAddress() : Mage_Customer_Model_Address_Abstract
Return values
Mage_Customer_Model_Address_AbstractgetSystemConfigPathsWhereUsedAsDefault()
Collect all system config paths where current template is used as default
public
getSystemConfigPathsWhereUsedAsDefault() : array<string|int, mixed>
Return values
array<string|int, mixed>getSystemConfigPathsWhereUsedCurrently()
Collect all system config paths where current template is currently used
public
getSystemConfigPathsWhereUsedCurrently() : array<string|int, mixed>
Return values
array<string|int, mixed>getTemplateActual()
public
getTemplateActual() : int
Return values
intgetTemplateByConfigPath()
Get template code for template directive
public
getTemplateByConfigPath(string $configPath, array<string|int, mixed> $variables) : string
Parameters
- $configPath : string
- $variables : array<string|int, mixed>
Return values
stringgetTemplateCode()
public
getTemplateCode() : string
Return values
stringgetTemplateFilter()
Get filter object for template processing logi
public
getTemplateFilter() : Mage_Core_Model_Email_Template_Filter
Return values
Mage_Core_Model_Email_Template_FiltergetTemplateId()
public
getTemplateId() : int
Return values
intgetTemplateSenderEmail()
public
getTemplateSenderEmail() : string
Return values
stringgetTemplateSenderName()
public
getTemplateSenderName() : string
Return values
stringgetTemplateStyles()
public
getTemplateStyles() : string
Return values
stringgetTemplateSubject()
public
getTemplateSubject() : string
Return values
stringgetTemplateText()
public
getTemplateText() : string
Return values
stringgetTemplateType()
public
getTemplateType() : int
Return values
intgetType()
Getter for template type
public
getType() : int|string
Attributes
- #[Override]
Return values
int|stringgetUseAbsoluteLinks()
public
getUseAbsoluteLinks() : bool
Return values
boolgetVariablesOptionArray()
Retrieve option array of variables
public
getVariablesOptionArray([bool $withGroup = false ]) : array<string|int, mixed>
Parameters
- $withGroup : bool = false
-
if true wrap variable options in group
Return values
array<string|int, mixed>hasData()
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
public
hasData([string $key = '' ]) : bool
Parameters
- $key : string = ''
Return values
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolhasErrors()
public
hasErrors() : bool
Return values
boolhasQueue()
public
hasQueue() : int
Return values
intisDeleted()
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
public
isDeleted([bool $isDeleted = null ]) : bool
Parameters
- $isDeleted : bool = null
Return values
boolisDirty()
public
isDirty([string $field = null ]) : bool
Parameters
- $field : string = null
Return values
boolisEmpty()
checks whether the object is empty
public
isEmpty() : bool
Return values
boolisModuleEnabled()
public
isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
- $moduleName : string
- $helperAlias : string = 'core'
Return values
boolisObjectNew()
Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
public
isObjectNew([bool $flag = null ]) : bool
Parameters
- $flag : bool = null
Return values
boolisPlain()
Return true if template type eq text
public
isPlain() : bool
Return values
boolisValidForSend()
Return true if this template can be used for sending queue as main template
public
isValidForSend() : bool
Return values
booljsonSerialize()
Implementation of JsonSerializable::jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:
- If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
- If a nested DataObject has a custom toJson() method, it's converted to JSON string
- If a nested DataObject uses only the base implementations, it's excluded from output
This prevents infinite recursion and circular references when serializing object hierarchies.
Attributes
- #[Override]
Return values
array<string|int, mixed>load()
Load object data
public
load(string|null|int $id[, string|null $field = null ]) : $this
Parameters
- $id : string|null|int
- $field : string|null = null
Return values
$thisloadByCode()
Load template by code
public
loadByCode(string $templateCode) : $this
Parameters
- $templateCode : string
Return values
$thisloadByConfigPath()
Load template by configuration path. This enables html templates to include other html templates by their system configuration XPATH value
public
loadByConfigPath(string $configPath) : $this|null
Parameters
- $configPath : string
-
The path to the config setting that defines which global/template/email/* node should be used to load the email template
Return values
$this|nullloadDefault()
Load default email template from locale translate
public
loadDefault(string $templateId[, string $locale = null ]) : $this
Parameters
- $templateId : string
- $locale : string = null
Return values
$thisoffsetExists()
Implementation of ArrayAccess::offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Attributes
- #[Override]
Return values
booloffsetGet()
Implementation of ArrayAccess::offsetGet()
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Tags
Attributes
- #[Override]
- #[ReturnTypeWillChange]
offsetSet()
Implementation of ArrayAccess::offsetSet()
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
- $value : mixed
Tags
Attributes
- #[Override]
offsetUnset()
Implementation of ArrayAccess::offsetUnset()
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
Attributes
- #[Override]
revertDesign()
Revert to last design config, used before emulation
public
revertDesign() : mixed
save()
Save object data
public
save() : $this
Tags
Return values
$thissend()
Send mail to recipient
public
send(array<string|int, mixed>|string $email[, array<string|int, mixed>|string|null $name = null ][, array<string|int, mixed> $variables = [] ]) : bool
Parameters
- $email : array<string|int, mixed>|string
-
E-mail(s)
- $name : array<string|int, mixed>|string|null = null
-
receiver name(s)
- $variables : array<string|int, mixed> = []
-
template variables
Return values
boolsendTransactional()
Send transactional email to recipient
public
sendTransactional(string|int $templateId, array<string|int, mixed>|string $sender, string $email, array<string|int, mixed>|string|null $name[, array<string|int, mixed> $vars = [] ][, int|null $storeId = null ]) : $this
Parameters
- $templateId : string|int
- $sender : array<string|int, mixed>|string
-
sender information, can be declared as part of config path
- $email : string
-
recipient email
- $name : array<string|int, mixed>|string|null
-
recipient name
- $vars : array<string|int, mixed> = []
-
variables which can be used in template
- $storeId : int|null = null
Tags
Return values
$thisserialize()
serialize object attributes
public
serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
- $attributes : array<string|int, mixed> = []
- $valueSeparator : string = '='
- $fieldSeparator : string = ' '
- $quote : string = '"'
Return values
stringsetAddedAt()
public
setAddedAt(string $value) : $this
Parameters
- $value : string
Return values
$thissetAttachments()
Set the attachments to add to the email
public
setAttachments(array<string|int, Mage_Core_Model_Email_Attachment> $attachments) : $this
Parameters
- $attachments : array<string|int, Mage_Core_Model_Email_Attachment>
Return values
$thissetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetCreatedAt()
public
setCreatedAt(string $value) : $this
Parameters
- $value : string
Return values
$thissetData()
Overwrite data in the object.
public
setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
$key can be string or array. If $key is string, the attribute value will be overwritten by $value
If $key is an array, it will overwrite all the data in the object.
Parameters
- $key : string|array<string|int, mixed>
- $value : mixed = null
Return values
$thissetDataChanges()
Clears data changes status
public
setDataChanges(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetDataUsingMethod()
Set object data with calling setter method
public
setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
- $key : string
- $args : mixed = []
Return values
$thissetDesignConfig()
Initialize design information for template processing
public
setDesignConfig(array<string|int, mixed> $config) : $this
Parameters
- $config : array<string|int, mixed>
Return values
$thissetId()
Set id of template
public
setId(int $value) : $this
Parameters
- $value : int
Attributes
- #[Override]
Return values
$thissetIdFieldName()
set name of object id field
public
setIdFieldName(string $name) : $this
Parameters
- $name : string
Return values
$thissetInlineCssFile()
public
setInlineCssFile(string $value) : $this
Parameters
- $value : string
Return values
$thissetModifiedAt()
public
setModifiedAt(string $value) : $this
Parameters
- $value : string
Return values
$thissetOrigData()
Initialize object original data
public
setOrigData([string $key = null ][, mixed $data = null ]) : $this
Parameters
- $key : string = null
- $data : mixed = null
Return values
$thissetOrigTemplateCode()
public
setOrigTemplateCode(string $value) : $this
Parameters
- $value : string
Return values
$thissetOrigTemplateVariables()
public
setOrigTemplateVariables(string $value) : $this
Parameters
- $value : string
Return values
$thissetQueue()
public
setQueue(Mage_Core_Model_Email_Queue $value) : $this
Parameters
- $value : Mage_Core_Model_Email_Queue
Return values
$thissetQueueName()
public
setQueueName(string $value) : $this
Parameters
- $value : string
Return values
$thissetReplyTo()
Add Reply-To header
public
setReplyTo(string $email) : $this
Parameters
- $email : string
Return values
$thissetReturnPath()
Set Return Path
public
setReturnPath(string $email) : $this
Parameters
- $email : string
Return values
$thissetSenderEmail()
public
setSenderEmail(string $value) : $this
Parameters
- $value : string
Return values
$thissetSenderName()
public
setSenderName(string $value) : $this
Parameters
- $value : string
Return values
$thissetSentSuccess()
public
setSentSuccess(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetTemplateCode()
public
setTemplateCode(string $value) : $this
Parameters
- $value : string
Return values
$thissetTemplateFilter()
Declare template processing filter
public
setTemplateFilter(Template $filter) : $this
Parameters
- $filter : Template
Return values
$thissetTemplateId()
public
setTemplateId(int $value) : $this
Parameters
- $value : int
Return values
$thissetTemplateSenderEmail()
public
setTemplateSenderEmail(string $value) : $this
Parameters
- $value : string
Return values
$thissetTemplateSenderName()
public
setTemplateSenderName(string $value) : $this
Parameters
- $value : string
Return values
$thissetTemplateStyles()
public
setTemplateStyles(string $value) : $this
Parameters
- $value : string
Return values
$thissetTemplateSubject()
public
setTemplateSubject(string $value) : $this
Parameters
- $value : string
Return values
$thissetTemplateText()
public
setTemplateText(string $value) : $this
Parameters
- $value : string
Return values
$thissetTemplateType()
public
setTemplateType(int $value) : $this
Parameters
- $value : int
Return values
$thissetUpdatedAt()
public
setUpdatedAt(string $currentTime) : $this
Parameters
- $currentTime : string
Return values
$thissetUseAbsoluteLinks()
public
setUseAbsoluteLinks(bool $value) : void
Parameters
- $value : bool
toArray()
Public wrapper for __toArray
public
toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Public wrapper for __toJson
public
toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
stringtoString()
Public wrapper for __toString
public
toString([string $format = '' ]) : string
Will use $format as an template and substitute {{key}} for attributes
Parameters
- $format : string = ''
Return values
stringtoXml()
Public wrapper for __toXml
public
toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
- $rootName : string = 'item'
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
stringunsetData()
Unset data from the object.
public
unsetData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsetOldData()
Unset old fields data from the object.
public
unsetOldData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$this__toJson()
Convert object attributes to JSON
protected
__toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
string__toXml()
Convert object attributes to XML
protected
__toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
- $rootName : string = 'item'
-
name of the root element
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
string_addEmailVariables()
Add variables that are used by transactional emails and newsletter emails
protected
_addEmailVariables(array<string|int, mixed> $variables, int $storeId) : array<string|int, mixed>
Parameters
- $variables : array<string|int, mixed>
- $storeId : int
Return values
array<string|int, mixed>_addFullNames()
protected
_addFullNames() : mixed
_afterDelete()
Delete current usage
protected
_afterDelete() : $this
Attributes
- #[Override]
Return values
$this_afterDeleteCommit()
Processing manipulation after main transaction commit
protected
_afterDeleteCommit() : $this
Return values
$this_afterLoad()
Processing object after load data
protected
_afterLoad() : $this
Return values
$this_afterSave()
Processing object after save data
protected
_afterSave() : $this
Return values
$this_applyDesignConfig()
Applying of design config
protected
_applyDesignConfig() : $this
Return values
$this_applyInlineCss()
Merge HTML and CSS and returns HTML that has CSS styles applied "inline" to the HTML tags. This is necessary in order to support all email clients.
protected
_applyInlineCss(string $html) : string
Parameters
- $html : string
Return values
string_beforeDelete()
Processing object before delete data
protected
_beforeDelete() : $this
Return values
$this_beforeLoad()
Processing object before load data
protected
_beforeLoad(int $id[, string|null $field = null ]) : $this
Parameters
- $id : int
- $field : string|null = null
Return values
$this_beforeSave()
Validate email template code
protected
_beforeSave() : $this
Attributes
- #[Override]
Return values
$this_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_cancelDesignConfig()
Revert design settings to previous
protected
_cancelDesignConfig() : $this
Return values
$this_clearData()
Clearing object's data
protected
_clearData() : $this
Return values
$this_clearReferences()
Clearing cyclic references
protected
_clearReferences() : $this
Return values
$this_construct()
Internal constructor not depended on params. Can be used for object initialization
protected
_construct() : void
Attributes
- #[Override]
_getCssByConfig()
Accepts a path to a System Config setting that contains a comma-delimited list of files to load. Loads those files and then returns the concatenated content.
protected
_getCssByConfig(string $configPath) : string
Parameters
- $configPath : string
Return values
string_getCssFileContent()
Load CSS content from filesystem
protected
_getCssFileContent(string $filename) : string
Parameters
- $filename : string
Return values
string_getData()
Get value from _data array without parse key
protected
_getData(string $key) : mixed
Parameters
- $key : string
_getEventData()
Get array of objects transferred to default events processing
protected
_getEventData() : array<string|int, mixed>
Return values
array<string|int, mixed>_getLogoAlt()
Return logo alt for emails
protected
_getLogoAlt(Mage_Core_Model_Store|int|string $store) : string
Parameters
- $store : Mage_Core_Model_Store|int|string
Return values
string_getLogoUrl()
Return logo URL for emails Take logo from skin if custom logo is undefined
protected
_getLogoUrl(Mage_Core_Model_Store|int|string $store) : string
Parameters
- $store : Mage_Core_Model_Store|int|string
Return values
string_getNonInlineCssTag()
Loads content of files with non-inline CSS styles and merges them with any CSS styles that are specified within the <!--@styles @--> comments or in the Transactional Emails
protected
_getNonInlineCssTag() : string
Return values
string_hasModelChanged()
Check whether model has changed data.
protected
_hasModelChanged() : bool
Can be overloaded in child classes to perform advanced check whether model needs to be saved e.g. using resourceModel->hasDataChanged() or any other technique
Return values
bool_init()
Standard model initialization
protected
_init(string $resourceModel) : mixed
Parameters
- $resourceModel : string
_initOldFieldsMap()
Inits mapping array of object's previously used fields to new fields.
protected
_initOldFieldsMap() : mixed
Must be overloaded by descendants to set concrete fields map.
_parseVariablesString()
Parse variables string into array of variables
protected
_parseVariablesString(string $variablesString) : array<string|int, mixed>
Parameters
- $variablesString : string
Return values
array<string|int, mixed>_prepareArray()
Set required array elements
protected
_prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
- $elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>_prepareSyncFieldsMap()
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
protected
_prepareSyncFieldsMap() : $this
Return values
$this_protectFromNonAdmin()
Safeguard func that will check, if we are in admin area
protected
_protectFromNonAdmin() : mixed
Tags
_setResourceModel()
Set resource names
protected
_setResourceModel(string $resourceName[, string|null $resourceCollectionName = null ]) : mixed
If collection name is omitted, resource name will be used with _collection appended
Parameters
- $resourceName : string
- $resourceCollectionName : string|null = null
_underscore()
Converts field names for setters and getters
protected
_underscore(string $name) : string
$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace
Parameters
- $name : string
Return values
stringgetDesignConfig()
Get design configuration data
protected
getDesignConfig() : DataObject