Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
EMailer Class Reference

Public Member Functions

 init ()
 __construct ()
 setPathLayouts ($value)
 getPathLayouts ()
 setPathViews ($value)
 getPathViews ()
 __call ($method, $params)
 __set ($name, $value)
 __get ($name)
 __sleep ()
 __wakeup ()
 getView ($view, $vars=array(), $layout=null)

Protected Attributes

 $pathViews = 'application.views.email'
 $pathLayouts = 'application.views.email.layouts'

Detailed Description

Definition at line 42 of file EMailer.php.

Constructor & Destructor Documentation

EMailer::__construct ( )

Constructor. Here the instance of PHPMailer is created.

Definition at line 87 of file EMailer.php.

{
$this->_myMailer = new PHPMailer(true);
}

Member Function Documentation

EMailer::__call (   $method,
  $params 
)

Call a PHPMailer function

Parameters
string$methodthe method to call
array$paramsthe parameters
Returns
mixed

Definition at line 151 of file EMailer.php.

{
if (is_object($this->_myMailer) && get_class($this->_myMailer)==='PHPMailer') return call_user_func_array(array($this->_myMailer, $method), $params);
else throw new CException(Yii::t('EMailer', 'Can not call a method of a non existent object'));
}
EMailer::__get (   $name)

Getter

Parameters
string$name
Returns
mixed

Definition at line 175 of file EMailer.php.

{
if (is_object($this->_myMailer) && get_class($this->_myMailer)==='PHPMailer') return $this->_myMailer->$name;
else throw new CException(Yii::t('EMailer', 'Can not access a property of a non existent object'));
}
EMailer::__set (   $name,
  $value 
)

Setter

Parameters
string$namethe property name
string$valuethe property value

Definition at line 163 of file EMailer.php.

{
if (is_object($this->_myMailer) && get_class($this->_myMailer)==='PHPMailer') $this->_myMailer->$name = $value;
else throw new CException(Yii::t('EMailer', 'Can not set a property of a non existent object'));
}
EMailer::__sleep ( )

Cleanup work before serializing. This is a PHP defined magic method.

Returns
array the names of instance-variables to serialize.

Definition at line 186 of file EMailer.php.

{
}
EMailer::__wakeup ( )

This method will be automatically called when unserialization happens. This is a PHP defined magic method.

Definition at line 194 of file EMailer.php.

{
}
EMailer::getPathLayouts ( )

Getter

Returns
string pathLayouts

Definition at line 113 of file EMailer.php.

{
return $this->pathLayouts;
}
EMailer::getPathViews ( )

Getter

Returns
string pathViews

Definition at line 135 of file EMailer.php.

{
return $this->pathViews;
}
EMailer::getView (   $view,
  $vars = array(),
  $layout = null 
)

Displays an e-mail in preview mode.

Parameters
string$viewthe class
array$vars
string$layout

Definition at line 209 of file EMailer.php.

{
$body = Yii::app()->controller->renderPartial($this->pathViews.'.'.$view, array_merge($vars, array('content'=>$this->_myMailer)), true);
if ($layout === null) {
$this->_myMailer->Body = $body;
}
else {
$this->_myMailer->Body = Yii::app()->controller->renderPartial($this->pathLayouts.'.'.$layout, array('content'=>$body), true);
}
}
EMailer::init ( )

Init method for the application component mode.

Definition at line 82 of file EMailer.php.

{}
EMailer::setPathLayouts (   $value)

Setter

Parameters
string$valuepathLayouts

Definition at line 101 of file EMailer.php.

{
if (!is_string($value) && !preg_match("/[a-z0-9\.]/i"))
throw new CException(Yii::t('EMailer', 'pathLayouts must be a Yii alias path'));
$this->pathLayouts = $value;
}
EMailer::setPathViews (   $value)

Setter

Parameters
string$valuepathViews

Definition at line 123 of file EMailer.php.

{
if (!is_string($value) && !preg_match("/[a-z0-9\.]/i"))
throw new CException(Yii::t('EMailer', 'pathViews must be a Yii alias path'));
$this->pathViews = $value;
}

The documentation for this class was generated from the following file: