PHP Class Pimcore\Mail

Inheritance: extends Zend_Mail
Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Méthodes publiques

Свойство Type Description
$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 Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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"

Méthodes protégées

Méthode Description
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)

Method Details

__construct() public méthode

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

addBcc() public méthode

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
Résultat Mail Provides fluent interface

addCc() public méthode

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
Résultat Pimcore_Mail Provides fluent interface

addTo() public méthode

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
Résultat Mail Provides fluent interface

addToTemporaryStorage() protected méthode

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 méthode

protected checkDebugMode ( )

clearRecipients() public méthode

Clears list of recipient email addresses and resets the temporary storage
public clearRecipients ( ) : Mail
Résultat Mail Provides fluent interface

determineHtml2TextIsInstalled() public static méthode

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
Résultat boolean

disableLogging() public méthode

Disables email logging
public disableLogging ( ) : Mail
Résultat Mail Provides fluent interface

enableHtml2textBinary() public méthode

enableLogging() public méthode

Enables email logging (by default it's enabled)
public enableLogging ( ) : Mail
Résultat Mail Provides fluent interface

getBodyHtmlRendered() public méthode

Replaces the placeholders with the content and returns the rendered Html
public getBodyHtmlRendered ( ) : string | null
Résultat string | null

getBodyTextRendered() public méthode

Replaces the placeholders with the content and returns the rendered text if a text was set with "$mail->setBodyText()" *
public getBodyTextRendered ( ) : string
Résultat string

getDocument() public méthode

Returns the Document
public getDocument ( ) : Email
Résultat Pimcore\Model\Document\Email | null

getEnableLayoutOnPlaceholderRendering() public méthode

getHostUrl() public méthode

public getHostUrl ( ) : null
Résultat null

getHtml2TextBinaryEnabled() public méthode

public getHtml2TextBinaryEnabled ( ) : boolean
Résultat boolean

getHtml2TextOptions() public méthode

Returns options for html2text
public getHtml2TextOptions ( ) : string
Résultat string

getHtml2textInstalled() public static méthode

public static getHtml2textInstalled ( ) : boolean
Résultat boolean || null

getIgnoreDebugMode() public méthode

Checks if the Debug mode is ignored
public getIgnoreDebugMode ( ) : boolean
Résultat boolean

getParam() public méthode

Returns a parameter which was set with "setParams" or "setParam"
public getParam ( string | integer $key ) : mixed
$key string | integer
Résultat mixed

getParams() public méthode

Returns the parameters which were set with "setParams" or "setParam"
public getParams ( ) : array
Résultat array

getSubjectRendered() public méthode

Replaces the placeholders with the content and returns the rendered Subject
public getSubjectRendered ( ) : string
Résultat string

getTemporaryStorage() public méthode

Returns the temporary storage
public getTemporaryStorage ( ) : array
Résultat array

html2Text() protected méthode

protected html2Text ( $htmlContent ) : string
$htmlContent
Résultat string

init() public méthode

Initializes the mailer with the settings form Settings -> System -> Email Settings
public init ( $type = "email" ) : void
Résultat void

isValidEmailAddress() public static méthode

Static helper to validate a email address
public static isValidEmailAddress ( $emailAddress ) : boolean
$emailAddress
Résultat boolean

loggingIsEnabled() public méthode

returns the logging status
public loggingIsEnabled ( ) : boolean
Résultat boolean

preventDebugInformationAppending() public méthode

Prevents appending of debug information (used for resending emails)
public preventDebugInformationAppending ( ) : Mail
Résultat Mail

send() public méthode

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
Résultat Mail Provides fluent interface

sendWithoutRendering() public méthode

see also comments of send() method
public sendWithoutRendering ( null $transport = null ) : Zend_Mail
$transport null
Résultat Zend_Mail

setDocument() public méthode

public setDocument ( $document )
$document

setDocumentSettings() protected méthode

Sets the settings which are defined in the Document Settings (from,to,cc,bcc)
protected setDocumentSettings ( ) : Mail
Résultat Mail Provides fluent interface

setEnableLayoutOnPlaceholderRendering() public méthode

public setEnableLayoutOnPlaceholderRendering ( $value )
$value

setFrom() public méthode

public setFrom ( string $email, null $name = null ) : Zend_Mail
$email string
$name null
Résultat Zend_Mail

setHostUrl() public méthode

public setHostUrl ( $url )
$url

setHtml2TextOptions() public méthode

Sets options that are passed to html2text
public setHtml2TextOptions ( string $options = '' ) : Mail
$options string
Résultat Mail

setIgnoreDebugMode() public méthode

public setIgnoreDebugMode ( $value )
$value

setParam() public méthode

Sets a single parameter for the email view and the Placeholders
public setParam ( string | integer $key, mixed $value ) : Mail
$key string | integer
$value mixed
Résultat Mail Provides fluent interface

setParams() public méthode

Sets the parameters for the email view and the Placeholders
public setParams ( array $params ) : Mail
$params array
Résultat Mail Provides fluent interface

setSender() public méthode

Sets From-header and sender of the message
public setSender ( string $email ) : Zend_Mail
$email string
Résultat Zend_Mail Provides fluent interface

setTo() public méthode

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

unsetParam() public méthode

Deletes a single parameter which was set with "setParams" or "setParam"
public unsetParam ( string | integer $key ) : Mail
$key string | integer
Résultat Mail Provides fluent interface

unsetParams() public méthode

Deletes parameters which were set with "setParams" or "setParam"
public unsetParams ( array $params ) : Mail
$params array
Résultat Mail Provides fluent interface

Property Details

$debugEmailAddresses protected_oe static_oe property

Contains the debug email addresses from settings -> system -> Email Settings -> Debug email addresses
protected static array $debugEmailAddresses
Résultat array

$document protected_oe property

Contains the email document
protected Email,Pimcore\Model\Document $document
Résultat Pimcore\Model\Document\Email

$enableLayoutOnPlaceholderRendering protected_oe property

if true - the layout is enabled when document is rendered to a string
protected bool $enableLayoutOnPlaceholderRendering
Résultat boolean

$forcePimcoreMode public_oe static_oe property

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
Résultat boolean

$hostUrl protected_oe property

if $hostUrl is set - this url well be used to create absolute urls otherwise it is determined automatically
See also: MailHelper::setAbsolutePaths()
protected null $hostUrl
Résultat null

$html2textBinaryEnabled protected_oe property

use html2text from mbayer if it is installed (http://www.mbayer.de/html2text/)
protected bool $html2textBinaryEnabled
Résultat boolean

$html2textInstalled protected_oe static_oe property

html2text from mbayer is installed (http://www.mbayer.de/html2text/)
protected static bool $html2textInstalled
Résultat boolean

$html2textOptions protected_oe property

Options passed to html2text
protected string $html2textOptions
Résultat string

$ignoreDebugMode protected_oe property

if true - the Pimcore debug mode is ignored
protected bool $ignoreDebugMode
Résultat boolean

$loggingEnable protected_oe property

If true - emails are logged in the database and on the file-system
protected bool $loggingEnable
Résultat boolean

$params protected_oe property

Contains the dynamic Params for the Placeholders
protected array $params
Résultat array

$placeholderObject protected_oe property

Pimcore_Placeholder
protected $placeholderObject

$preventDebugInformationAppending protected_oe property

Prevent adding debug information
protected bool $preventDebugInformationAppending
Résultat boolean

$recipientsCleared protected_oe property

protected bool $recipientsCleared
Résultat boolean

$temporaryStorage protected_oe property

Contains data that has to be stored temporary e.g. email receivers for logging
protected array $temporaryStorage
Résultat array