Пример #1
0
 protected function afterSaveObject($values)
 {
     parent::afterSaveObject($values);
     if (isset($values->sendInstructions) && $values->sendInstructions) {
         $template = $this->createTemplate();
         $template->administrationTemplates = __DIR__ . '/../templates';
         // TODO: move to service? like aprilaMailManager?
         $mailMessage = new Message();
         // todo remove context
         $mailMessage->setFrom($this->context->parameters['email']['from']);
         $template->username = $values->username;
         $template->email = $values->email;
         $template->password = $values->password;
         $template->setFile(__DIR__ . "/templates/User.sendInstructions.latte");
         $basePath = __DIR__ . '/templates/';
         $mailMessage->addTo($values->email)->setHtmlBody($template, $basePath);
         $this->mailer->send($mailMessage);
     }
 }
Пример #2
0
 protected function beforeRender()
 {
     parent::beforeRender();
     $this->template->administrationTemplates = __DIR__ . '/../templates';
 }