Class TEmailLogRoute
TEmailLogRoute class.
TEmailLogRoute sends selected log messages to email addresses. The target email addresses may be specified via Emails property. Optionally, you may set the email Subject and the SentFrom address.
Method Summary |
array
|
|
string
|
|
string
|
|
void
|
Initializes the route.
|
protected
void
|
Sends log messages to specified email addresses.
|
array|string
|
|
void
|
|
void
|
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Method Details |
getEmails
public array getEmails |
() |
Output |
array
| list of destination email addresses |
Exception |
|
getSentFrom
public string getSentFrom |
() |
Output |
string
| send from address of the email |
Exception |
|
getSubject
public string getSubject |
() |
Output |
string
| email subject. Defaults to TEmailLogRoute::DEFAULT_SUBJECT |
Exception |
|
init
Initializes the route.
Input |
TXmlElement | $config | configurations specified in TLogRouter. |
Output |
Exception |
throws | TConfigurationException if SentFrom is empty and 'sendmail_from' in php.ini is also empty. |
|
processLogs
protected void processLogs |
(array $logs ) |
Sends log messages to specified email addresses.
Input |
array | $logs | list of log messages |
Output |
Exception |
|
setEmails
public array|string setEmails |
(mixed $emails ) |
Input |
mixed | $emails | |
Output |
array|string
| list of destination email addresses. If the value is a string, it is assumed to be comma-separated email addresses. |
Exception |
|
setSentFrom
public void setSentFrom |
(string $value ) |
Input |
string | $value | send from address of the email |
Output |
Exception |
|
setSubject
public void setSubject |
(string $value ) |
Input |
string | $value | email subject. |
Output |
Exception |
|
Constant Details |
DEFAULT_SUBJECT
Default email subject.
Type:
string
Value:
'Prado Application Log'
|
EMAIL_PATTERN
Regex pattern for email address.
Type:
string
Value:
'/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/'
|
|