public/src/EmailControl/Email.php
private function sparkPost()
    {
        try {
            $httpClient = new GuzzleAdapter(new Client());
            $sparky = new SparkPost($httpClient, ['key' => EMAILKEY, 'async' => false]);

            $response = $sparky->transmissions->post([
                'content' => [
                    'from' => ['name' => $this->remetenteNome, 'email' => $this->remetenteEmail],
                    'subject' => $this->assunto,
                    'html' => $this->html,
                    'text' => trim(strip_tags($this->mensagem)),
                    'attachments' => $this->anexo,
                ],
                'recipients' => $this->destinatarioEmail
            ]);

            if ($response->getStatusCode() === 200)
                $this->result = $response->getBody()['results']['id'];
            else
                $this->error = $response->getStatusCode();

        } catch (\Exception $e) {
            $this->error = 'Erro Inexperado ao enviar';
        }
    }
private function sparkPost()
    {
        try {
            $httpClient = new GuzzleAdapter(new Client());
            $sparky = new SparkPost($httpClient, ['key' => EMAILKEY, 'async' => false]);

            $response = $sparky->transmissions->post([
                'content' => [
                    'from' => ['name' => $this->remetenteNome, 'email' => $this->remetenteEmail],
                    'subject' => $this->assunto,
                    'html' => $this->html,
                    'text' => trim(strip_tags($this->mensagem)),
                    'attachments' => $this->anexo,
                ],
                'recipients' => $this->destinatarioEmail
            ]);

            if ($response->getStatusCode() === 200)
                $this->result = $response->getBody()['results']['id'];
            else
                $this->error = $response->getStatusCode();

        } catch (\Exception $e) {
            $this->error = 'Erro Inexperado ao enviar';
        }
    }
/*
***************************************
**********  PRIVATE METHODS  **********
***************************************