PHP Класс Pimcore\Mail

Наследование: extends Zend_Mail
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$forcePimcoreMode boolean forces the mail class to always us the "Pimcore Mode", so you don't have to set the charset every time when you create new Pimcore_Mail instance

Защищенные свойства (Protected)

Свойство Тип Описание
$debugEmailAddresses array Contains the debug email addresses from settings -> system -> Email Settings -> Debug email addresses
$document Pimcore\Model\Document\Email Contains the email document
$enableLayoutOnPlaceholderRendering boolean if true - the layout is enabled when document is rendered to a string
$hostUrl null if $hostUrl is set - this url well be used to create absolute urls otherwise it is determined automatically
$html2textBinaryEnabled boolean use html2text from mbayer if it is installed (http://www.mbayer.de/html2text/)
$html2textInstalled boolean html2text from mbayer is installed (http://www.mbayer.de/html2text/)
$html2textOptions string Options passed to html2text
$ignoreDebugMode boolean if true - the Pimcore debug mode is ignored
$loggingEnable boolean If true - emails are logged in the database and on the file-system
$params array Contains the dynamic Params for the Placeholders
$placeholderObject Pimcore_Placeholder
$preventDebugInformationAppending boolean Prevent adding debug information
$recipientsCleared boolean
$temporaryStorage array Contains data that has to be stored temporary e.g. email receivers for logging

Открытые методы

Метод Описание
__construct ( null $charset = null )
addBcc ( string | array $email ) : Mail Adds Bcc recipient, $email can be an array, or a single string address Additionally adds recipients to temporary storage
addCc ( string | array $email, string $name = '' ) : Pimcore_Mail Adds Cc-header and recipient, $email can be an array, or a single string address Additionally adds recipients to temporary storage
addTo ( string | array $email, string $name = '' ) : Mail Adds To-header and recipient, $email can be an array, or a single string address Additionally adds recipients to temporary storage
clearRecipients ( ) : Mail Clears list of recipient email addresses and resets the temporary storage
determineHtml2TextIsInstalled ( ) : boolean Determines if mbayer html2text is installed (more information at http://www.mbayer.de/html2text/) and uses it to automatically create a text version of the html email
disableLogging ( ) : Mail Disables email logging
enableHtml2textBinary ( )
enableLogging ( ) : Mail Enables email logging (by default it's enabled)
getBodyHtmlRendered ( ) : string | null Replaces the placeholders with the content and returns the rendered Html
getBodyTextRendered ( ) : string Replaces the placeholders with the content and returns the rendered text if a text was set with "$mail->setBodyText()" *
getDocument ( ) : Email Returns the Document
getEnableLayoutOnPlaceholderRendering ( ) : boolean
getHostUrl ( ) : null
getHtml2TextBinaryEnabled ( ) : boolean
getHtml2TextOptions ( ) : string Returns options for html2text
getHtml2textInstalled ( ) : boolean
getIgnoreDebugMode ( ) : boolean Checks if the Debug mode is ignored
getParam ( string | integer $key ) : mixed Returns a parameter which was set with "setParams" or "setParam"
getParams ( ) : array Returns the parameters which were set with "setParams" or "setParam"
getSubjectRendered ( ) : string Replaces the placeholders with the content and returns the rendered Subject
getTemporaryStorage ( ) : array Returns the temporary storage
init ( $type = "email" ) : void Initializes the mailer with the settings form Settings -> System -> Email Settings
isValidEmailAddress ( $emailAddress ) : boolean Static helper to validate a email address
loggingIsEnabled ( ) : boolean returns the logging status
preventDebugInformationAppending ( ) : Mail Prevents appending of debug information (used for resending emails)
send ( Zend_Mail_Transport_Abstract $transport = null ) : Mail Sends this email using the given transport or with the settings from "Settings" -> "System" -> "Email Settings"
sendWithoutRendering ( null $transport = null ) : Zend_Mail sends mail without (re)rendering the content.
setDocument ( $document )
setEnableLayoutOnPlaceholderRendering ( $value )
setFrom ( string $email, null $name = null ) : Zend_Mail
setHostUrl ( $url )
setHtml2TextOptions ( string $options = '' ) : Mail Sets options that are passed to html2text
setIgnoreDebugMode ( $value )
setParam ( string | integer $key, mixed $value ) : Mail Sets a single parameter for the email view and the Placeholders
setParams ( array $params ) : Mail Sets the parameters for the email view and the Placeholders
setSender ( string $email ) : Zend_Mail Sets From-header and sender of the message
setTo ( $email, $name = '' )
unsetParam ( string | integer $key ) : Mail Deletes a single parameter which was set with "setParams" or "setParam"
unsetParams ( array $params ) : Mail Deletes parameters which were set with "setParams" or "setParam"

Защищенные методы

Метод Описание
addToTemporaryStorage ( string $key, string | array $email, string $name ) Helper to add receivers to the temporary storage
checkDebugMode ( )
html2Text ( $htmlContent ) : string
setDocumentSettings ( ) : Mail Sets the settings which are defined in the Document Settings (from,to,cc,bcc)

Описание методов

__construct() публичный Метод

public __construct ( null $charset = null )
$charset null

addBcc() публичный Метод

Adds Bcc recipient, $email can be an array, or a single string address Additionally adds recipients to temporary storage
public addBcc ( string | array $email ) : Mail
$email string | array
Результат Mail Provides fluent interface

addCc() публичный Метод

Adds Cc-header and recipient, $email can be an array, or a single string address Additionally adds recipients to temporary storage
public addCc ( string | array $email, string $name = '' ) : Pimcore_Mail
$email string | array
$name string
Результат Pimcore_Mail Provides fluent interface

addTo() публичный Метод

Adds To-header and recipient, $email can be an array, or a single string address Additionally adds recipients to temporary storage
public addTo ( string | array $email, string $name = '' ) : Mail
$email string | array
$name string
Результат Mail Provides fluent interface

addToTemporaryStorage() защищенный Метод

Helper to add receivers to the temporary storage
protected addToTemporaryStorage ( string $key, string | array $email, string $name )
$key string
$email string | array
$name string

checkDebugMode() защищенный Метод

protected checkDebugMode ( )

clearRecipients() публичный Метод

Clears list of recipient email addresses and resets the temporary storage
public clearRecipients ( ) : Mail
Результат Mail Provides fluent interface

determineHtml2TextIsInstalled() публичный статический Метод

Determines if mbayer html2text is installed (more information at http://www.mbayer.de/html2text/) and uses it to automatically create a text version of the html email
public static determineHtml2TextIsInstalled ( ) : boolean
Результат boolean

disableLogging() публичный Метод

Disables email logging
public disableLogging ( ) : Mail
Результат Mail Provides fluent interface

enableHtml2textBinary() публичный Метод

enableLogging() публичный Метод

Enables email logging (by default it's enabled)
public enableLogging ( ) : Mail
Результат Mail Provides fluent interface

getBodyHtmlRendered() публичный Метод

Replaces the placeholders with the content and returns the rendered Html
public getBodyHtmlRendered ( ) : string | null
Результат string | null

getBodyTextRendered() публичный Метод

Replaces the placeholders with the content and returns the rendered text if a text was set with "$mail->setBodyText()" *
public getBodyTextRendered ( ) : string
Результат string

getDocument() публичный Метод

Returns the Document
public getDocument ( ) : Email
Результат Pimcore\Model\Document\Email | null

getEnableLayoutOnPlaceholderRendering() публичный Метод

public getEnableLayoutOnPlaceholderRendering ( ) : boolean
Результат boolean

getHostUrl() публичный Метод

public getHostUrl ( ) : null
Результат null

getHtml2TextBinaryEnabled() публичный Метод

public getHtml2TextBinaryEnabled ( ) : boolean
Результат boolean

getHtml2TextOptions() публичный Метод

Returns options for html2text
public getHtml2TextOptions ( ) : string
Результат string

getHtml2textInstalled() публичный статический Метод

public static getHtml2textInstalled ( ) : boolean
Результат boolean || null

getIgnoreDebugMode() публичный Метод

Checks if the Debug mode is ignored
public getIgnoreDebugMode ( ) : boolean
Результат boolean

getParam() публичный Метод

Returns a parameter which was set with "setParams" or "setParam"
public getParam ( string | integer $key ) : mixed
$key string | integer
Результат mixed

getParams() публичный Метод

Returns the parameters which were set with "setParams" or "setParam"
public getParams ( ) : array
Результат array

getSubjectRendered() публичный Метод

Replaces the placeholders with the content and returns the rendered Subject
public getSubjectRendered ( ) : string
Результат string

getTemporaryStorage() публичный Метод

Returns the temporary storage
public getTemporaryStorage ( ) : array
Результат array

html2Text() защищенный Метод

protected html2Text ( $htmlContent ) : string
$htmlContent
Результат string

init() публичный Метод

Initializes the mailer with the settings form Settings -> System -> Email Settings
public init ( $type = "email" ) : void
Результат void

isValidEmailAddress() публичный статический Метод

Static helper to validate a email address
public static isValidEmailAddress ( $emailAddress ) : boolean
$emailAddress
Результат boolean

loggingIsEnabled() публичный Метод

returns the logging status
public loggingIsEnabled ( ) : boolean
Результат boolean

preventDebugInformationAppending() публичный Метод

Prevents appending of debug information (used for resending emails)
public preventDebugInformationAppending ( ) : Mail
Результат Mail

send() публичный Метод

IMPORTANT: If the debug mode is enabled in "Settings" -> "System" -> "Debug" all emails will be sent to the debug email addresses that are given in "Settings" -> "System" -> "Email Settings" -> "Debug email addresses" set DefaultTransport or the internal mail function if no default transport had been set.
public send ( Zend_Mail_Transport_Abstract $transport = null ) : Mail
$transport Zend_Mail_Transport_Abstract
Результат Mail Provides fluent interface

sendWithoutRendering() публичный Метод

see also comments of send() method
public sendWithoutRendering ( null $transport = null ) : Zend_Mail
$transport null
Результат Zend_Mail

setDocument() публичный Метод

public setDocument ( $document )
$document

setDocumentSettings() защищенный Метод

Sets the settings which are defined in the Document Settings (from,to,cc,bcc)
protected setDocumentSettings ( ) : Mail
Результат Mail Provides fluent interface

setEnableLayoutOnPlaceholderRendering() публичный Метод

public setEnableLayoutOnPlaceholderRendering ( $value )
$value

setFrom() публичный Метод

public setFrom ( string $email, null $name = null ) : Zend_Mail
$email string
$name null
Результат Zend_Mail

setHostUrl() публичный Метод

public setHostUrl ( $url )
$url

setHtml2TextOptions() публичный Метод

Sets options that are passed to html2text
public setHtml2TextOptions ( string $options = '' ) : Mail
$options string
Результат Mail

setIgnoreDebugMode() публичный Метод

public setIgnoreDebugMode ( $value )
$value

setParam() публичный Метод

Sets a single parameter for the email view and the Placeholders
public setParam ( string | integer $key, mixed $value ) : Mail
$key string | integer
$value mixed
Результат Mail Provides fluent interface

setParams() публичный Метод

Sets the parameters for the email view and the Placeholders
public setParams ( array $params ) : Mail
$params array
Результат Mail Provides fluent interface

setSender() публичный Метод

Sets From-header and sender of the message
public setSender ( string $email ) : Zend_Mail
$email string
Результат Zend_Mail Provides fluent interface

setTo() публичный Метод

public setTo ( $email, $name = '' )

unsetParam() публичный Метод

Deletes a single parameter which was set with "setParams" or "setParam"
public unsetParam ( string | integer $key ) : Mail
$key string | integer
Результат Mail Provides fluent interface

unsetParams() публичный Метод

Deletes parameters which were set with "setParams" or "setParam"
public unsetParams ( array $params ) : Mail
$params array
Результат Mail Provides fluent interface

Описание свойств

$debugEmailAddresses защищенное статическое свойство

Contains the debug email addresses from settings -> system -> Email Settings -> Debug email addresses
protected static array $debugEmailAddresses
Результат array

$document защищенное свойство

Contains the email document
protected Email,Pimcore\Model\Document $document
Результат Pimcore\Model\Document\Email

$enableLayoutOnPlaceholderRendering защищенное свойство

if true - the layout is enabled when document is rendered to a string
protected bool $enableLayoutOnPlaceholderRendering
Результат boolean

$forcePimcoreMode публичное статическое свойство

forces the mail class to always us the "Pimcore Mode", so you don't have to set the charset every time when you create new Pimcore_Mail instance
public static bool $forcePimcoreMode
Результат boolean

$hostUrl защищенное свойство

if $hostUrl is set - this url well be used to create absolute urls otherwise it is determined automatically
См. также: MailHelper::setAbsolutePaths()
protected null $hostUrl
Результат null

$html2textBinaryEnabled защищенное свойство

use html2text from mbayer if it is installed (http://www.mbayer.de/html2text/)
protected bool $html2textBinaryEnabled
Результат boolean

$html2textInstalled защищенное статическое свойство

html2text from mbayer is installed (http://www.mbayer.de/html2text/)
protected static bool $html2textInstalled
Результат boolean

$html2textOptions защищенное свойство

Options passed to html2text
protected string $html2textOptions
Результат string

$ignoreDebugMode защищенное свойство

if true - the Pimcore debug mode is ignored
protected bool $ignoreDebugMode
Результат boolean

$loggingEnable защищенное свойство

If true - emails are logged in the database and on the file-system
protected bool $loggingEnable
Результат boolean

$params защищенное свойство

Contains the dynamic Params for the Placeholders
protected array $params
Результат array

$placeholderObject защищенное свойство

Pimcore_Placeholder
protected $placeholderObject

$preventDebugInformationAppending защищенное свойство

Prevent adding debug information
protected bool $preventDebugInformationAppending
Результат boolean

$recipientsCleared защищенное свойство

protected bool $recipientsCleared
Результат boolean

$temporaryStorage защищенное свойство

Contains data that has to be stored temporary e.g. email receivers for logging
protected array $temporaryStorage
Результат array