public function send($template, $data, $callback) { $builder = $this->mailer->MessageBuilder(); $message = new message($builder); $message->from($this->config->get('mail.from')); $this->view->appendData($data); $message->body($this->view->render($template)); call_user_func($callback, $message); $domain = $this->config->get('mail.domain'); $this->mailer->post("{$domain}/messages", $builder->getMessage()); }