function __construct($args) { $this->args = $args; $this->from = ArrayUtils::get($args, 'from', Yii::app()->params['mbtx']['defaultEmail']); $this->fromUser = ArrayUtils::get($args, 'fromUser', Yii::app()->params['mbtx']['registrationUser']); $this->to = ArrayUtils::get($args, 'to', null); if (!$this->to) { throw new ErrorException("to argument required"); } $this->cc = ArrayUtils::get($args, 'cc', null); $this->bcc = ArrayUtils::get($args, 'bcc', null); $this->subject = ArrayUtils::get($args, 'subject', ''); $this->body = ArrayUtils::get($args, 'body', ''); $this->view = ArrayUtils::get($args, 'view', null); }