report = $report; return $this; } protected function assemble() { $this->setDefaultElementDecorator(new CompatDecorator()); (new SendMail())->initConfigForm($this, $this->report); $this->addElement('submit', 'submit', [ 'label' => 'Send Report' ]); } public function onSuccess() { $values = $this->getValues(); $sendMail = new SendMail(); $sendMail->execute($this->report, $values); } }