public function afterRegistry()
 {
     $this->user = $this->loader->getUserLoader()->getUserByStaffId($this->staffId);
     parent::afterRegistry();
     $this->user = $this->loader->getUserLoader()->getUserByStaffId($this->staffId);
     $mailFields = $this->user->getMailFields();
     $this->addMailFields($mailFields);
     $this->addTo($this->user->getEmailAddress(), $this->user->getFullName());
     $this->setLanguage($this->user->getLocale());
 }
 public function afterRegistry()
 {
     if (!$this->respondent) {
         $this->respondent = $this->loader->getRespondent($this->patientId, $this->organizationId);
     }
     parent::afterRegistry();
     if ($this->respondent) {
         $this->addTo($this->respondent->getEmailAddress(), $this->respondent->getName());
         $this->setLanguage($this->respondent->getLanguage());
     }
 }