PHP Class Phalcon\Mailer\Manager

Inheritance: extends Phalcon\Mvc\User\Component
Show file Open project: phalcon/incubator

Protected Properties

Property Type Description
$config array
$mailer Swift_Mailer
$transport Swift_Transport
$view Phalcon\Mvc\View\Simple

Public Methods

Method Description
__construct ( array $config ) Create a new MailerManager component using $config for configuring
createMessage ( ) : Message Create a new Message instance.
createMessageFromView ( string $view, array $params = [], null | string $viewsDir = null ) : Message Create a new Message instance.
getSwift ( ) : Swift_Mailer Return a {@link \Swift_Mailer} instance
normalizeEmail ( $email ) : string Normalize IDN domains.

Protected Methods

Method Description
configure ( array $config ) Configure MailerManager class
getConfig ( null $key = null, null $default = null ) : string | array Get option config or the entire array of config, if the parameter $key is not specified.
getView ( ) : Phalcon\Mvc\View\Simple Return a {@link \Phalcon\Mvc\View\Simple} instance
punycode ( $str ) : string Convert UTF-8 encoded domain name to ASCII
registerSwiftMailer ( ) Register SwiftMailer
registerSwiftTransport ( ) Create a new Driver-mail of SwiftTransport instance.
registerTransportMail ( ) : Swift_MailTransport Create a new MailTransport instance.
registerTransportSendmail ( ) : Swift_SendmailTransport Create a new SendmailTransport instance.
registerTransportSmtp ( ) : Swift_SmtpTransport Create a new SmtpTransport instance.
renderView ( $viewPath, $params, null $viewsDir = null ) : string Renders a view

Method Details

__construct() public method

Create a new MailerManager component using $config for configuring
public __construct ( array $config )
$config array

configure() protected method

Configure MailerManager class
See also: Phalcon\Mailer\Manager::registerSwiftTransport()
See also: Phalcon\Mailer\Manager::registerSwiftMailer()
protected configure ( array $config )
$config array

createMessage() public method

Events: - mailer:beforeCreateMessage - mailer:afterCreateMessage
public createMessage ( ) : Message
return Message

createMessageFromView() public method

For the body of the message uses the result of render of view Events: - mailer:beforeCreateMessage - mailer:afterCreateMessage
See also: Phalcon\Mailer\Manager::createMessage()
public createMessageFromView ( string $view, array $params = [], null | string $viewsDir = null ) : Message
$view string
$params array optional
$viewsDir null | string optional
return Message

getConfig() protected method

Get option config or the entire array of config, if the parameter $key is not specified.
protected getConfig ( null $key = null, null $default = null ) : string | array
$key null
$default null
return string | array

getSwift() public method

Return a {@link \Swift_Mailer} instance
public getSwift ( ) : Swift_Mailer
return Swift_Mailer

getView() protected method

Return a {@link \Phalcon\Mvc\View\Simple} instance
protected getView ( ) : Phalcon\Mvc\View\Simple
return Phalcon\Mvc\View\Simple

normalizeEmail() public method

Normalize IDN domains.
See also: Phalcon\Mailer\Manager::punycode()
public normalizeEmail ( $email ) : string
$email
return string

punycode() protected method

Convert UTF-8 encoded domain name to ASCII
protected punycode ( $str ) : string
$str
return string

registerSwiftMailer() protected method

Register SwiftMailer
See also: Swift_Mailer
protected registerSwiftMailer ( )

registerSwiftTransport() protected method

Supported driver-mail: - smtp - sendmail - mail
protected registerSwiftTransport ( )

registerTransportMail() protected method

Create a new MailTransport instance.
See also: Swift_MailTransport
protected registerTransportMail ( ) : Swift_MailTransport
return Swift_MailTransport

registerTransportSendmail() protected method

Create a new SendmailTransport instance.
See also: Swift_SendmailTransport
protected registerTransportSendmail ( ) : Swift_SendmailTransport
return Swift_SendmailTransport

registerTransportSmtp() protected method

Create a new SmtpTransport instance.
See also: Swift_SmtpTransport
protected registerTransportSmtp ( ) : Swift_SmtpTransport
return Swift_SmtpTransport

renderView() protected method

Renders a view
protected renderView ( $viewPath, $params, null $viewsDir = null ) : string
$viewPath
$params
$viewsDir null
return string

Property Details

$config protected property

protected array $config
return array

$mailer protected property

protected Swift_Mailer $mailer
return Swift_Mailer

$transport protected property

protected Swift_Transport $transport
return Swift_Transport

$view protected property

protected Simple,Phalcon\Mvc\View $view
return Phalcon\Mvc\View\Simple