Свойство | Тип | Описание | |
---|---|---|---|
$backgroundColor | The hex color code of the background, must include the leading '#'. | ||
$button | An array representing a button with the following keys: 'url' => The href value of the button. 'text' => The button text. 'textColor' => The hex color code of the button text, must include the leading '#'. 'backgroundColor' => The hex color code of the button background, must include the leading '#'. | ||
$containerBackgroundColor | The hex color code of the container background, must include the leading '#'. | ||
$defaultButtonBackgroundColor | The default hex color code of the button background, must include the leading '#'. | ||
$defaultButtonTextColor | The default hex color code of the button text, must include the leading '#'. | ||
$footer | An array representing a footer with the following keys: 'text' => The HTML-formatted footer text. 'textColor' => The hex color code of the footer text, must include the leading '#'. 'backgroundColor' => The hex color code of the footer background, must include the leading '#'. | ||
$image | An array representing an image with the following keys: 'source' => The image source url. 'link' => The href value of the image wrapper. 'alt' => The alt value of the image tag. | ||
$lead | The HTML formatted email lead (sub-title, appears under title). | ||
$message | The HTML formatted email message (the body of the email). | ||
$plaintext | Whether to render in plaintext. | ||
$textColor | The hex color code of the text, must include the leading '#'. | ||
$title | The HTML formatted email title. | ||
$view | The path to the email view. |
Метод | Описание | |
---|---|---|
__construct ( string $message = '', string $title = '', string $lead = '', string $view = 'email-basic' ) | ||
getBackgroundColor ( ) : string | ||
getContainerBackgroundColor ( ) : string | ||
getDefaultButtonBackgroundColor ( ) : string | ||
getDefaultButtonTextColor ( ) : string | ||
getDefaultEmailImage ( ) : array | Retrieves default values for the email image. | |
getFooter ( ) : string | ||
getImage ( ) : array | ||
getLead ( ) : string | ||
getMessage ( ) : string | ||
getTextColor ( ) : string | ||
getTitle ( ) : string | ||
isPlaintext ( ) : boolean | ||
removeButton ( ) : EmailTemplate | Remove the button. | |
setBackgroundColor ( string $color ) : EmailTemplate | ||
setButton ( string $url, string $text, string $textColor = '', string $backgroundColor = '' ) : EmailTemplate | Set the button property. | |
setContainerBackgroundColor ( string $color ) : EmailTemplate | ||
setDefaultButtonBackgroundColor ( string $color ) : EmailTemplate | Sets the default color for the button background. | |
setDefaultButtonTextColor ( string $color ) : EmailTemplate | Sets the default color for the button text. | |
setFooter ( string $text, string $textColor = '', string $backgroundColor = '' ) : EmailTemplate | Sets the footer. The footer background and text colors default to the button background and text colors. | |
setImage ( string $sourceUrl = '', string $linkUrl = '', string $alt = '' ) : EmailTemplate | Set the image property. | |
setImageArray ( $image ) : EmailTemplate | Set the image property using an array with the following keys: 'source' => The image source url. | |
setLead ( string $lead ) : EmailTemplate | ||
setMessage ( string $message, boolean $convertNewlines = false, boolean $filter = false ) : EmailTemplate | ||
setPlaintext ( boolean $plainText ) | ||
setTextColor ( string $color ) : EmailTemplate | ||
setTitle ( string $title ) : EmailTemplate | ||
setView ( string $view, string $controllerName = 'email', string $applicationFolder = 'dashboard' ) : EmailTemplate | ||
toString ( ) : string | Render the email. |
Метод | Описание | |
---|---|---|
formatContent ( string $html, boolean $convertNewlines = false, boolean $filter = false ) : string | Filters an unsafe HTML string and returns it. | |
objectToArray ( EmailTemplate $email ) : array | Copies the email object to an array. A simple (array) typecast won't work, since the properties are protected and as such, add unwanted information to the array keys. | |
plainTextEmail ( ) : string | Renders a plaintext email. | |
setDefaultEmailImage ( ) | Sets the default image for the email template. |
public __construct ( string $message = '', string $title = '', string $lead = '', string $view = 'email-basic' ) | ||
$message | string | HTML formatted email message (the body of the email). |
$title | string | HTML formatted email title. |
$lead | string | HTML formatted email lead (sub-title, appears under title). |
$view | string |
protected formatContent ( string $html, boolean $convertNewlines = false, boolean $filter = false ) : string | ||
$html | string | The HTML to filter. |
$convertNewlines | boolean | Whether to convert new lines to html br tags. |
$filter | boolean | Whether to escape HTML or not. |
Результат | string | The filtered HTML string. |
public getBackgroundColor ( ) : string | ||
Результат | string | The hex color code of the background. |
public getContainerBackgroundColor ( ) : string | ||
Результат | string | The hex color code of the container background. |
public getDefaultButtonBackgroundColor ( ) : string | ||
Результат | string | The default hex color code of the button background, must include the leading '#'. |
public getDefaultButtonTextColor ( ) : string | ||
Результат | string | The default hex color code of the button text, must include the leading '#'. |
public getDefaultEmailImage ( ) : array | ||
Результат | array | An array representing an image. |
public getMessage ( ) : string | ||
Результат | string | The HTML formatted email message (the body of the email). |
public getTextColor ( ) : string | ||
Результат | string | The hex color code of the text. |
public isPlaintext ( ) : boolean | ||
Результат | boolean | Whether to render in plaintext. |
protected objectToArray ( EmailTemplate $email ) : array | ||
EmailTemplate | The email object. | |
Результат | array | Copy of email object in an array format for output. |
protected plainTextEmail ( ) : string | ||
Результат | string | A plaintext email. |
public removeButton ( ) : EmailTemplate | ||
Результат | EmailTemplate | $this The calling object. |
public setBackgroundColor ( string $color ) : EmailTemplate | ||
$color | string | The hex color code of the background, must include the leading '#'. |
Результат | EmailTemplate | $this The calling object. |
public setButton ( string $url, string $text, string $textColor = '', string $backgroundColor = '' ) : EmailTemplate | ||
$url | string | The href value of the button. |
$text | string | The button text. |
$textColor | string | The hex color code of the button text, must include the leading '#'. |
$backgroundColor | string | The hex color code of the button background, must include the leading '#'. |
Результат | EmailTemplate | $this The calling object. |
public setContainerBackgroundColor ( string $color ) : EmailTemplate | ||
$color | string | The hex color code of the container background, must include the leading '#'. |
Результат | EmailTemplate | $this The calling object. |
public setDefaultButtonBackgroundColor ( string $color ) : EmailTemplate | ||
$color | string | The default hex color code of the button background, must include the leading '#'. |
Результат | EmailTemplate | $this The calling object. |
public setDefaultButtonTextColor ( string $color ) : EmailTemplate | ||
$color | string | The default hex color code of the button text, must include the leading '#'. |
Результат | EmailTemplate | $this The calling object. |
protected setDefaultEmailImage ( ) |
public setImageArray ( $image ) : EmailTemplate | ||
Результат | EmailTemplate | $this The calling object. |
public setMessage ( string $message, boolean $convertNewlines = false, boolean $filter = false ) : EmailTemplate | ||
$message | string | The HTML formatted email message (the body of the email). |
$convertNewlines | boolean | Whether to convert new lines to html br tags. |
$filter | boolean | Whether to filter HTML or not. |
Результат | EmailTemplate | $this The calling object. |
public setPlaintext ( boolean $plainText ) | ||
$plainText | boolean | Whether to render in plaintext. |
public setTextColor ( string $color ) : EmailTemplate | ||
$color | string | The hex color code of the text, must include the leading '#'. |
Результат | EmailTemplate | $this The calling object. |
public setView ( string $view, string $controllerName = 'email', string $applicationFolder = 'dashboard' ) : EmailTemplate | ||
$view | string | The view name. |
$controllerName | string | The controller name for the view. |
$applicationFolder | string | The application folder for the view. |
Результат | EmailTemplate | $this The calling object. |
protected $backgroundColor |
protected $button |
protected $containerBackgroundColor |
protected $defaultButtonBackgroundColor |
protected $defaultButtonTextColor |
protected $image |
protected $lead |
protected $message |
protected $textColor |