PHP Класс Gdn_Email, vanilla

All public methods return $this for chaining purposes. ie. $Email->Subject('Hi')->Message('Just saying hi!')- To('[email protected]')->Send();
Наследование: extends Gdn_Pluggable
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$PhpMailer PHPMailer
$Skipped Recipients that were skipped because they lack permission.
$supportedFormats The supported email formats.

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

Свойство Тип Описание
$emailTemplate The email body renderer. Use this to edit the email body.
$format The format of the email.

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

Метод Описание
__construct ( ) Constructor.
addHeader ( string $Name, string $Value ) : Gdn_Email Add a custom header to the outgoing email.
addTo ( $RecipientEmail, $RecipientName = '' )
bcc ( mixed $RecipientEmail, string $RecipientName = '' ) : Gdn_Email Adds to the "Bcc" recipient collection.
cc ( mixed $RecipientEmail, string $RecipientName = '' ) : Gdn_Email Adds to the "Cc" recipient collection.
charset ( $Use = '' )
clear ( ) : Gdn_Email Clears out all previously specified values for this object and restores it to the state it was in when it was instantiated.
formatMessage ( $message )
from ( string $SenderEmail = '', string $SenderName = '', boolean $bOverrideSender = false ) : Gdn_Email Allows the explicit definition of the email's sender address & name.
getEmailTemplate ( ) : EmailTemplate
getFormat ( ) : string Get email format
getHTMLVersion ( $template ) : mixed | string
getTextVersion ( $template ) : boolean | mixed | string
masterView ( string $MasterView ) : Gdn_Email Allows the definition of a masterview other than the default: "email.master".
message ( string $message, boolean $convertNewlines = true, boolean $filter = true ) : Gdn_Email The message to be sent.
mimeType ( string $MimeType ) : Gdn_Email Sets the mime-type of the email.
send ( string $EventName = '' ) : boolean
setEmailTemplate ( EmailTemplate $emailTemplate ) : Gdn_Email
setFormat ( string $format ) : Gdn_Email Sets the format property, the email mime type and the email template format property.
subject ( string $Subject ) : Gdn_Email Adds subject of the message to the email.
to ( mixed $RecipientEmail, string $RecipientName = '' ) : Gdn_Email Adds to the "To" recipient collection.

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

Метод Описание
resolveFormat ( ) Sets the format property based on the config, and defaults to html.

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

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

Constructor.
public __construct ( )

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

Add a custom header to the outgoing email.
С версии: 2.1
public addHeader ( string $Name, string $Value ) : Gdn_Email
$Name string
$Value string
Результат Gdn_Email

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

public addTo ( $RecipientEmail, $RecipientName = '' )

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

Adds to the "Bcc" recipient collection.
public bcc ( mixed $RecipientEmail, string $RecipientName = '' ) : Gdn_Email
$RecipientEmail mixed An email (or array of emails) to add to the "Bcc" recipient collection.
$RecipientName string The recipient name associated with $RecipientEmail. If $RecipientEmail is an array of email addresses, this value will be ignored.
Результат Gdn_Email

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

Adds to the "Cc" recipient collection.
public cc ( mixed $RecipientEmail, string $RecipientName = '' ) : Gdn_Email
$RecipientEmail mixed An email (or array of emails) to add to the "Cc" recipient collection.
$RecipientName string The recipient name associated with $RecipientEmail. If $RecipientEmail is an array of email addresses, this value will be ignored.
Результат Gdn_Email

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

public charset ( $Use = '' )

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

Clears out all previously specified values for this object and restores it to the state it was in when it was instantiated.
public clear ( ) : Gdn_Email
Результат Gdn_Email

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

public formatMessage ( $message )

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

Defaults to the applications Configuration 'SupportEmail' & 'SupportName' settings respectively.
public from ( string $SenderEmail = '', string $SenderName = '', boolean $bOverrideSender = false ) : Gdn_Email
$SenderEmail string
$SenderName string
$bOverrideSender boolean optional. default false.
Результат Gdn_Email

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

public getEmailTemplate ( ) : EmailTemplate
Результат EmailTemplate The email body renderer.

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

Returns 'text' or 'html'.
public getFormat ( ) : string
Результат string

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

public static getHTMLVersion ( $template ) : mixed | string
$template
Результат mixed | string

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

public static getTextVersion ( $template ) : boolean | mixed | string
$template
Результат boolean | mixed | string

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

Allows the definition of a masterview other than the default: "email.master".
Устаревший: since version 2.2
public masterView ( string $MasterView ) : Gdn_Email
$MasterView string
Результат Gdn_Email

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

The message to be sent.
public message ( string $message, boolean $convertNewlines = true, boolean $filter = true ) : Gdn_Email
$message string The body of the message to be sent.
$convertNewlines boolean Optional. Convert newlines to br tags
$filter boolean Optional. Filter HTML.
Результат Gdn_Email

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

Only accept text/plain or text/html.
public mimeType ( string $MimeType ) : Gdn_Email
$MimeType string The mime-type of the email.
Результат Gdn_Email

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

Sets the format property based on the config, and defaults to html.
protected resolveFormat ( )

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

public send ( string $EventName = '' ) : boolean
$EventName string
Результат boolean

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

public setEmailTemplate ( EmailTemplate $emailTemplate ) : Gdn_Email
$emailTemplate EmailTemplate The email body renderer.
Результат Gdn_Email

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

Sets the format property, the email mime type and the email template format property.
public setFormat ( string $format ) : Gdn_Email
$format string The format of the email. Must be in the $supportedFormats array.
Результат Gdn_Email

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

Adds subject of the message to the email.
public subject ( string $Subject ) : Gdn_Email
$Subject string The subject of the message.
Результат Gdn_Email

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

Adds to the "To" recipient collection.
public to ( mixed $RecipientEmail, string $RecipientName = '' ) : Gdn_Email
$RecipientEmail mixed An email (or array of emails) to add to the "To" recipient collection.
$RecipientName string The recipient name associated with $RecipientEmail. If $RecipientEmail is an array of email addresses, this value will be ignored.
Результат Gdn_Email

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

$PhpMailer публичное свойство

public PHPMailer $PhpMailer
Результат PHPMailer

$Skipped публичное свойство

Recipients that were skipped because they lack permission.
public $Skipped

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

The email body renderer. Use this to edit the email body.
protected $emailTemplate

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

The format of the email.
protected $format

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

The supported email formats.
public static $supportedFormats