/** * @param \Orm\Entity\OptIn $optin * @param string $charset * @return \Cms\Mail */ public function getRenewPasswordMail(\Orm\Entity\OptIn $optin, $charset = 'utf-8') { $config = Registry::getConfig(); $baseUrl = Registry::getBaseUrl(); $optinUser = $optin->getUser(); $locale = self::getLocale($optinUser->getLanguage()); $fromUser = $this->getMailFromUserData(array('email' => $config->user->mail->renew->password->from->address, 'name' => $config->user->mail->renew->password->from->name)); $this->view->clearVars(); $this->view->optin = $optin; $this->view->optinUser = $optinUser; $this->view->optinUrl = $baseUrl . $config->user->mail->renew->password->uri; $this->view->spaceUrl = $baseUrl; $this->view->fromName = $fromUser['name']; $this->view->fromEmail = $fromUser['email']; $renewMail = new \Cms\Mail($charset); $renewMail->setBodyText($this->view->render($this->getTemplateFilename(__FUNCTION__, $locale))); // the subject is set in mail template $subject = $this->view->subject; $renewMail->setFrom($fromUser['email'], $fromUser['name']); $renewMail->setSubject($subject); $renewMail->addTo($optinUser->getEmail(), $optinUser->getFirstname() . ' ' . $optinUser->getLastname()); return $renewMail; }
/** * {@inheritDoc} */ public function getUser() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUser', array()); return parent::getUser(); }