dev-master
9999999-devWrapper php para comunicação com a api locaweb
Unlicense
The Requires
by Diego Botelho
v1.0
1.0.0.0Wrapper php para comunicação com a api locaweb
Apache
The Requires
by Diego Botelho
Wrapper php para comunicação com a api locaweb
Wrapper php para comunicação com a api SMTP da locaweb, (*1)
$ composer require dibmartins/locaweb, (*2)
http://developer.locaweb.com.br/documentacoes/smtp/api-como-utilizar/, (*3)
Para enviar um e-mail:, (*4)
try{ require_once('../../vendor/autoload.php'); $api = new \Locaweb\Api('https://api.smtplw.com.br/v1/', 'your_auth_token'); $message = new \Locaweb\Message($api); $response = $message->post([ 'headers' => ['Content-Type': 'text/plain'], // 'text/html' para body em html 'subject' => "qualquer titulo", 'body' => "qualquer corpo", 'from' => "remetente@dominio.com", 'to' => "destinatario@dominio2.com", 'cc' => ['cc1@dominio2.com', 'cc2@dominio2.com'], 'bcc' => ['bcc1@dominio2.com', 'bcc2@dominio2.com'] ]); var_dump($response); } catch(\Locaweb\Exception $e){ var_dump($e); }
Consulta utilizando filtros, (*5)
try{ require_once('../../vendor/autoload.php'); $api = new \Locaweb\Api('https://api.smtplw.com.br/v1/', 'your_auth_token'); $message = new \Locaweb\Message($api); $hoje = new \DateTime(); $response = $message->get([ 'status' => 'all', 'start_date' => $hoje->format('Y-m-d'), 'end_date' => $hoje->format('Y-m-d'), 'page' => 1, 'per' => 100 ]); var_dump($response); } catch(\Locaweb\Exception $e){ var_dump($e); }
Consulta utilizando id, (*6)
try{ require_once('../../vendor/autoload.php'); $api = new \Locaweb\Api('https://api.smtplw.com.br/v1/', 'your_auth_token'); $message = new \Locaweb\Message($api); $response = $message->getById(37764); var_dump($response); } catch(\Locaweb\Exception $e){ var_dump($e); }
Copyright (c) 2018 Diego Botelho, (*7)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*8)
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*9)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*10)
Wrapper php para comunicação com a api locaweb
Unlicense
Wrapper php para comunicação com a api locaweb
Apache