HtmlMailer
extends Document
in package
Build & Send email.
Table of Contents
Properties
- $allItems : array<string|int, mixed>
- Array of links to all embedded objects.
- $crLf : mixed
- $drawStatus : bool
- Has the page already been rendered ?
- $emailAddress : string
- Sender's email address.
- $emailSubject : string
- Subject of email.
- $finalized : bool
- $fromEmailAddress : string
- Sender's email address.
- $htmlBody : null|BodyTag|Embedable
- Pointer to the BODY html document.
- $htmlBodyRendered : string
- Already rendered HTML.
- $htmlDocument : Container
- Page object for rendering to email.
- $htmlHead : SimpleHeadTag|null
- $lastItem : object
- A link to the last element added.
- $mailBody : mixed
- $mailer : mixed
- Object for sending mail.
- $mailHeaders : mixed
- $mailHeadersDone : mixed
- $mimer : mixed
- $notify : bool
- Show user information about sending a message?
- $pageClosed : bool
- Is page closed for adding new contents?
- $pageParts : array<string|int, mixed>
- Array of objects and fragments to draw.
- $parameters : array<string|int, mixed>
- Outgoing mail parameters.
- $raiseItems : array<string|int, mixed>
- Which objects to take over from the accepting object.
- $sendResult : bool|null
- Has the message already been sent?
- $textBody : mixed
- $webPage : WebPage
- A link to the base object of the page.
- $embedName : string|null
- $instance : mixed
- Saves object instance (singleton...).
Methods
- __construct() : mixed
- Ease Mail - compiles and sends.
- __toString() : string
- Render Obect (and its contents) as string.
- addAsFirst() : mixed
- Inserts as the first element in the object.
- addCSS() : bool
- Add another CSS definition to stack.
- addFile() : bool
- Attaches an attachment from a file to the mail.
- addItem() : mixed
- Adds an item to the body of the mail.
- addItemCustom() : mixed
- Inserts another element into the object.
- addItems() : array<string|int, mixed>
- Insert an array of elements.
- addJavaScript() : int
- Inserts JavaScript into the page.
- addNextTo() : Container
- Inserts another element after the existing one.
- addToLastItem() : null|Container
- Adds an item to the last inserted item.
- afterAdd() : void
- Method executed after adding object into new one.
- arrayToUrlParams() : mixed
- Returns fields as URL parameters.
- draw() : void
- Do not draw mail included in page.
- drawAllContents() : void
- It recursively scans all inserted objects and calls their draw ().
- drawIfNotDrawn() : void
- Draw contents not drawn yet.
- embedablize() : Embedable
- Always returns Embedable item.
- emptyContents() : void
- Empty container contents.
- finalize() : void
- Builds the body of the mail.
- getContents() : BodyTag
- Gives you current Body.
- getFirstPart() : mixed
- Returns the first inserted item.
- getGetValue() : string
- Returns the value of the page key parameter.
- getItemsCount() : int
- Obtain item count.
- getMailHeader() : string
- Returns the contents of the mail header.
- getPostValue() : mixed
- Returns the value of the page key parameter.
- getRendered() : string
- Returns the rendered contents of objects.
- getRequestValue() : mixed
- Returns the value of the page call parameter key.
- getRequestValues() : array<string|int, mixed>
- Returns $_REQUEST field.
- getUri() : string
- Returns the desired address.
- includeCss() : bool
- Include an CSS file call into page.
- includeJavaScript() : string
- Includes Javascript into the page.
- isEmpty() : bool
- Is object empty ?
- isFinalized() : bool
- Returns the status of the part finalization of the flag.
- isFormPosted() : bool
- Was the page displayed after the form was submitted using the POST method?
- isPosted() : bool
- Is page called by Form Post ?
- lastItem() : Brick|mixed
- Vrací odkaz na poslední vloženou položku.
- makePagePublic() : bool
- Open Previously closed Web Page.
- onlyForLogged() : bool
- Redirects the unlogged-in user to the login page.
- phpSelf() : string
- Returns the current URL. This is instead of PHP_SELF which is unsafe.
- redirect() : void
- Perform http redirect.
- registerItem() : void
- Registers the item for finalization.
- sanitizeAsType() : mixed
- It treats the transformation according to its expected type.
- send() : bool
- Send mail.
- setEmbedName() : bool
- Notify component about its embed name.
- setFinalized() : void
- Set label of parts finalized.
- setMailHeaders() : bool
- Sets mail headers.
- setUserNotification() : void
- Sets the user notification flag.
- singleton() : WebPage
- suicide() : mixed
- Allows an already inserted object to be removed from the tree for rendering.
- webPage() : WebPage
- Returns or registers an instance of a Web page.
Properties
$allItems
Array of links to all embedded objects.
public
static array<string|int, mixed>
$allItems
= []
of pointers to all items to be rendered
$crLf
public
mixed
$crLf
= "\n"
$drawStatus
Has the page already been rendered ?
public
bool
$drawStatus
= false
$emailAddress
Sender's email address.
public
string
$emailAddress
= ''
$emailSubject
Subject of email.
public
string
$emailSubject
= ''
$finalized
public
bool
$finalized
= false
$fromEmailAddress
Sender's email address.
public
string
$fromEmailAddress
= ''
$htmlBody
Pointer to the BODY html document.
public
null|BodyTag|Embedable
$htmlBody
$htmlBodyRendered
Already rendered HTML.
public
string
$htmlBodyRendered
= ''
$htmlDocument
Page object for rendering to email.
public
Container
$htmlDocument
$htmlHead
public
SimpleHeadTag|null
$htmlHead
= null
$lastItem
A link to the last element added.
public
object
$lastItem
$mailBody
public
mixed
$mailBody
$mailer
Object for sending mail.
public
mixed
$mailer
$mailHeaders
public
mixed
$mailHeaders
= []
$mailHeadersDone
public
mixed
$mailHeadersDone
$mimer
public
mixed
$mimer
$notify
Show user information about sending a message?
public
bool
$notify
= true
$pageClosed
Is page closed for adding new contents?
public
static bool
$pageClosed
= false
$pageParts
Array of objects and fragments to draw.
public
array<string|int, mixed>
$pageParts
= []
$parameters
Outgoing mail parameters.
public
array<string|int, mixed>
$parameters
= []
$raiseItems
Which objects to take over from the accepting object.
public
array<string|int, mixed>
$raiseItems
= ['SetUpUser' => 'User', 'webPage', 'OutputFormat']
$sendResult
Has the message already been sent?
public
bool|null
$sendResult
= false
$textBody
public
mixed
$textBody
$webPage
A link to the base object of the page.
public
static WebPage
$webPage
$embedName
private
string|null
$embedName
= null
$instance
Saves object instance (singleton...).
private
static mixed
$instance
Methods
__construct()
Ease Mail - compiles and sends.
public
__construct(string $emailAddress, string $mailSubject[, mixed $emailContents = '' ][, array<string|int, mixed> $headers = [] ]) : mixed
Parameters
- $emailAddress : string
-
address
- $mailSubject : string
-
subject
- $emailContents : mixed = ''
-
body - any mix of text and EaseObjects
- $headers : array<string|int, mixed> = []
-
override Mail Headers
__toString()
Render Obect (and its contents) as string.
public
__toString() : string
Return values
stringaddAsFirst()
Inserts as the first element in the object.
public
& addAsFirst(mixed $pageItem[, string $pageItemName = null ]) : mixed
Parameters
- $pageItem : mixed
-
value or EaseObject with draw () method
- $pageItemName : string = null
-
Under this name, object is inserted into the tree
Return values
mixed —A link to the embedded object
addCSS()
Add another CSS definition to stack.
public
addCSS(string $css) : bool
Parameters
- $css : string
-
css definition
Return values
booladdFile()
Attaches an attachment from a file to the mail.
public
addFile(string $filename[, string $mimeType = 'text/plain' ]) : bool
Parameters
- $filename : string
-
path / file name to attach
- $mimeType : string = 'text/plain'
-
MIME attachment type
Return values
bool —file attachment successful
addItem()
Adds an item to the body of the mail.
public
& addItem(mixed $item) : mixed
Parameters
- $item : mixed
-
EaseObject or anything with the draw (); method
Return values
mixed —pointer to the inserted content
addItemCustom()
Inserts another element into the object.
public
static & addItemCustom(Embedable|string $pageItem, Embedable $context) : mixed
Parameters
- $pageItem : Embedable|string
-
value or EaseObject with draw () method
- $context : Embedable
-
Object into which elements / items are inserted
Return values
mixed —Pointer to embed object
addItems()
Insert an array of elements.
public
addItems(array<string|int, mixed> $itemes) : array<string|int, mixed>
Parameters
- $itemes : array<string|int, mixed>
-
value field or EaseObject with draw () method
Return values
array<string|int, mixed> —inserted items
addJavaScript()
Inserts JavaScript into the page.
public
addJavaScript(string $javaScript[, string $position = '0' ][, bool $inDocumentReady = true ]) : int
Parameters
- $javaScript : string
-
JS code
- $position : string = '0'
-
final position: '+','-','0','--',...
- $inDocumentReady : bool = true
-
to insert into a DocumentReady block?
Return values
intaddNextTo()
Inserts another element after the existing one.
public
& addNextTo(mixed $pageItem) : Container
Parameters
- $pageItem : mixed
-
value or EaseObject with draw () method
Return values
Container —A link to the embedded object
addToLastItem()
Adds an item to the last inserted item.
public
addToLastItem(object $pageItem) : null|Container
Parameters
- $pageItem : object
-
value or EaseObject with draw () method
Return values
null|Container —success
afterAdd()
Method executed after adding object into new one.
public
afterAdd() : void
arrayToUrlParams()
Returns fields as URL parameters.
public
static arrayToUrlParams(array<string|int, mixed> $params[, string $baseUrl = '' ]) : mixed
Parameters
- $params : array<string|int, mixed>
- $baseUrl : string = ''
draw()
Do not draw mail included in page.
public
draw() : void
Attributes
- #[Override]
drawAllContents()
It recursively scans all inserted objects and calls their draw ().
public
drawAllContents() : void
drawIfNotDrawn()
Draw contents not drawn yet.
public
drawIfNotDrawn() : void
embedablize()
Always returns Embedable item.
public
static embedablize(mixed $item) : Embedable
Parameters
- $item : mixed
Return values
EmbedableemptyContents()
Empty container contents.
public
emptyContents() : void
finalize()
Builds the body of the mail.
public
finalize() : void
Attributes
- #[Override]
getContents()
Gives you current Body.
public
getContents() : BodyTag
Return values
BodyTaggetFirstPart()
Returns the first inserted item.
public
getFirstPart() : mixed
getGetValue()
Returns the value of the page key parameter.
public
static getGetValue(string $field[, string $sanitizeAs = null ]) : string
Parameters
- $field : string
-
key GET
- $sanitizeAs : string = null
-
treat the returned value as float|int|string
Return values
stringgetItemsCount()
Obtain item count.
public
getItemsCount() : int
Return values
intgetMailHeader()
Returns the contents of the mail header.
public
getMailHeader(string $headername) : string
Parameters
- $headername : string
-
header name
Return values
stringgetPostValue()
Returns the value of the page key parameter.
public
static getPostValue(string $field[, string $sanitizeAs = null ]) : mixed
Parameters
- $field : string
-
key POST
- $sanitizeAs : string = null
-
treat the returned value as float|int|string
getRendered()
Returns the rendered contents of objects.
public
getRendered() : string
Return values
stringgetRequestValue()
Returns the value of the page call parameter key.
public
static getRequestValue(string $field[, string $sanitizeAs = null ]) : mixed
Parameters
- $field : string
-
key POST or GET
- $sanitizeAs : string = null
-
treat the returned value as float|int|string
getRequestValues()
Returns $_REQUEST field.
public
getRequestValues() : array<string|int, mixed>
Return values
array<string|int, mixed>getUri()
Returns the desired address.
public
static getUri() : string
Return values
stringincludeCss()
Include an CSS file call into page.
public
includeCss(string $cssFile[, bool $fwPrefix = false ][, string $media = 'screen' ]) : bool
Parameters
- $cssFile : string
-
path to the file inserted into the page
- $fwPrefix : bool = false
-
add framework prefix (usually/Ease/) ?
- $media : string = 'screen'
-
medium screen | print | braile etc ...
Return values
boolincludeJavaScript()
Includes Javascript into the page.
public
includeJavaScript(string $javaScriptFile[, string $position = null ]) : string
Parameters
- $javaScriptFile : string
-
javascriptem using file
- $position : string = null
-
final positione: '+','-','0','--',...
Return values
stringisEmpty()
Is object empty ?
public
isEmpty() : bool
Return values
bool —emptiness
isFinalized()
Returns the status of the part finalization of the flag.
public
isFinalized() : bool
Return values
boolisFormPosted()
Was the page displayed after the form was submitted using the POST method?
public
static isFormPosted() : bool
Tags
Return values
boolisPosted()
Is page called by Form Post ?
public
static isPosted() : bool
Return values
boollastItem()
Vrací odkaz na poslední vloženou položku.
public
& lastItem() : Brick|mixed
Return values
Brick|mixedmakePagePublic()
Open Previously closed Web Page.
public
makePagePublic() : bool
Return values
boolonlyForLogged()
Redirects the unlogged-in user to the login page.
public
onlyForLogged([string $loginPage = 'login.php' ][, null|mixed $message = null ]) : bool
Parameters
- $loginPage : string = 'login.php'
-
login page address
- $message : null|mixed = null
Return values
bool —Logged
phpSelf()
Returns the current URL. This is instead of PHP_SELF which is unsafe.
public
static phpSelf([bool $dropqs = true ]) : string
Parameters
- $dropqs : bool = true
-
whether to drop the querystring or not. Default true
Return values
string —the current URL or NULL for php-cli
redirect()
Perform http redirect.
public
redirect(string $url) : void
Parameters
- $url : string
-
redirect to URL
registerItem()
Registers the item for finalization.
public
static registerItem(mixed &$itemPointer) : void
Parameters
- $itemPointer : mixed
sanitizeAsType()
It treats the transformation according to its expected type.
public
static sanitizeAsType(mixed $value, string $sanitizeAs) : mixed
Parameters
- $value : mixed
-
value
- $sanitizeAs : string
-
value type int|string|float|null
send()
Send mail.
public
send() : bool
Return values
boolsetEmbedName()
Notify component about its embed name.
public
setEmbedName(string $embedName) : bool
Parameters
- $embedName : string
-
parent::$pageParts[$embedName] == self
Return values
bool —success
setFinalized()
Set label of parts finalized.
public
setFinalized([bool $flag = true ]) : void
Parameters
- $flag : bool = true
-
finalization flag
setMailHeaders()
Sets mail headers.
public
setMailHeaders(mixed $mailHeaders) : bool
Parameters
- $mailHeaders : mixed
-
associative array of headers
Return values
bool —true if the headers have been set
setUserNotification()
Sets the user notification flag.
public
setUserNotification(bool $notify) : void
Parameters
- $notify : bool
-
required notification status
singleton()
public
static singleton() : WebPage
Return values
WebPagesuicide()
Allows an already inserted object to be removed from the tree for rendering.
public
suicide() : mixed
webPage()
Returns or registers an instance of a Web page.
public
static & webPage([WebPage $oPage = null ]) : WebPage
Parameters
- $oPage : WebPage = null
-
website object to register