PHP 클래스 EmailTemplate, vanilla

파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

메소드 상세

__construct() 공개 메소드

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

formatContent() 보호된 메소드

Filters an unsafe HTML string and returns it.
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.

getBackgroundColor() 공개 메소드

public getBackgroundColor ( ) : string
리턴 string The hex color code of the background.

getContainerBackgroundColor() 공개 메소드

public getContainerBackgroundColor ( ) : string
리턴 string The hex color code of the container background.

getDefaultButtonBackgroundColor() 공개 메소드

public getDefaultButtonBackgroundColor ( ) : string
리턴 string The default hex color code of the button background, must include the leading '#'.

getDefaultButtonTextColor() 공개 메소드

public getDefaultButtonTextColor ( ) : string
리턴 string The default hex color code of the button text, must include the leading '#'.

getDefaultEmailImage() 공개 메소드

Retrieves default values for the email image.
public getDefaultEmailImage ( ) : array
리턴 array An array representing an image.

getFooter() 공개 메소드

public getFooter ( ) : string
리턴 string The HTML formatted email footer.

getImage() 공개 메소드

public getImage ( ) : array
리턴 array 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.

getLead() 공개 메소드

public getLead ( ) : string
리턴 string The HTML formatted email lead (sub-title, appears under title).

getMessage() 공개 메소드

public getMessage ( ) : string
리턴 string The HTML formatted email message (the body of the email).

getTextColor() 공개 메소드

public getTextColor ( ) : string
리턴 string The hex color code of the text.

getTitle() 공개 메소드

public getTitle ( ) : string
리턴 string The HTML formatted email title.

isPlaintext() 공개 메소드

public isPlaintext ( ) : boolean
리턴 boolean Whether to render in plaintext.

objectToArray() 보호된 메소드

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.
protected objectToArray ( EmailTemplate $email ) : array
$email EmailTemplate The email object.
리턴 array Copy of email object in an array format for output.

plainTextEmail() 보호된 메소드

Renders a plaintext email.
protected plainTextEmail ( ) : string
리턴 string A plaintext email.

removeButton() 공개 메소드

Remove the button.
public removeButton ( ) : EmailTemplate
리턴 EmailTemplate $this The calling object.

setBackgroundColor() 공개 메소드

public setBackgroundColor ( string $color ) : EmailTemplate
$color string The hex color code of the background, must include the leading '#'.
리턴 EmailTemplate $this The calling object.

setButton() 공개 메소드

Set the button property.
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.

setContainerBackgroundColor() 공개 메소드

public setContainerBackgroundColor ( string $color ) : EmailTemplate
$color string The hex color code of the container background, must include the leading '#'.
리턴 EmailTemplate $this The calling object.

setDefaultButtonBackgroundColor() 공개 메소드

The background color of the EmailTemplate's button property can be overridden by setting $button['backgroundColor']
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.

setDefaultButtonTextColor() 공개 메소드

The text color of the EmailTemplate's button property can be overridden by setting $button['textColor']
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.

setDefaultEmailImage() 보호된 메소드

Sets the default image for the email template.
protected setDefaultEmailImage ( )

setFooter() 공개 메소드

Sets the footer. The footer background and text colors default to the button background and text colors.
public setFooter ( string $text, string $textColor = '', string $backgroundColor = '' ) : EmailTemplate
$text string The HTML formatted email footer text.
$textColor string The hex color code of the footer text, must include the leading '#'.
$backgroundColor string The hex color code of the footer background, must include the leading '#'.
리턴 EmailTemplate $this The calling object.

setImage() 공개 메소드

Set the image property.
public setImage ( string $sourceUrl = '', string $linkUrl = '', string $alt = '' ) : EmailTemplate
$sourceUrl string The image source url.
$linkUrl string The href value of the image wrapper.
$alt string The alt value of the img tag.
리턴 EmailTemplate $this The calling object.

setImageArray() 공개 메소드

'link' => The href value of the image wrapper. 'alt' => The alt value of the img tag.
public setImageArray ( $image ) : EmailTemplate
리턴 EmailTemplate $this The calling object.

setLead() 공개 메소드

public setLead ( string $lead ) : EmailTemplate
$lead string The HTML formatted email lead (sub-title, appears under title).
리턴 EmailTemplate $this The calling object.

setMessage() 공개 메소드

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.

setPlaintext() 공개 메소드

public setPlaintext ( boolean $plainText )
$plainText boolean Whether to render in plaintext.

setTextColor() 공개 메소드

public setTextColor ( string $color ) : EmailTemplate
$color string The hex color code of the text, must include the leading '#'.
리턴 EmailTemplate $this The calling object.

setTitle() 공개 메소드

public setTitle ( string $title ) : EmailTemplate
$title string The HTML formatted email title.
리턴 EmailTemplate $this The calling object.

setView() 공개 메소드

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.

toString() 공개 메소드

Render the email.
public toString ( ) : string
리턴 string The rendered email.

프로퍼티 상세

$backgroundColor 보호되어 있는 프로퍼티

The hex color code of the background, must include the leading '#'.
protected $backgroundColor

$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 '#'.
protected $button

$containerBackgroundColor 보호되어 있는 프로퍼티

The hex color code of the container background, must include the leading '#'.
protected $containerBackgroundColor

$defaultButtonBackgroundColor 보호되어 있는 프로퍼티

The default hex color code of the button background, must include the leading '#'.
protected $defaultButtonBackgroundColor

$defaultButtonTextColor 보호되어 있는 프로퍼티

The default hex color code of the button text, must include the leading '#'.
protected $defaultButtonTextColor

$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.
protected $image

$lead 보호되어 있는 프로퍼티

The HTML formatted email lead (sub-title, appears under title).
protected $lead

$message 보호되어 있는 프로퍼티

The HTML formatted email message (the body of the email).
protected $message

$plaintext 보호되어 있는 프로퍼티

Whether to render in plaintext.
protected $plaintext

$textColor 보호되어 있는 프로퍼티

The hex color code of the text, must include the leading '#'.
protected $textColor

$title 보호되어 있는 프로퍼티

The HTML formatted email title.
protected $title

$view 보호되어 있는 프로퍼티

The path to the email view.
protected $view