mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
cambiado controlador test para evitar errores en el merge
This commit is contained in:
@ -29,53 +29,16 @@ class Test extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
private function index()
|
||||||
{
|
{
|
||||||
$modelCliente = model('App\Models\Clientes\ClienteModel');
|
$this->emailService = service('emailService');
|
||||||
var_dump($modelCliente->getPendienteCobro(1284));
|
|
||||||
}
|
$a= $this->emailService->send('prueba', 'Esto es una prueba', ['imnavajas@coit.es','imnavajas@gmail.com']);
|
||||||
|
|
||||||
private function sendMail($subject, $body, $recipient)
|
echo var_dump($a);
|
||||||
{
|
|
||||||
$settings_model = new SettingsModel();
|
|
||||||
$config = $settings_model->first()->toArray();
|
|
||||||
$gateway = $config['email_gateway'];
|
|
||||||
$body = html_entity_decode($body);
|
|
||||||
|
|
||||||
if ($gateway == 'smtp') {
|
|
||||||
try {
|
|
||||||
//https://codeigniter.com/user_guide/libraries/email.html
|
|
||||||
$email = \Config\Services::email();
|
|
||||||
$config['protocol'] = $config['email_gateway'];
|
|
||||||
$config['SMTPHost'] = $config['email_smtp'];
|
|
||||||
$config['SMTPUser'] = $config['email_address'];
|
|
||||||
$config['SMTPPass'] = $config['email_pass'];
|
|
||||||
$config['SMTPPort'] = intval($config['email_port']);
|
|
||||||
$config['SMTPCrypto'] = $config['email_cert'] == 'none' ? '' : $config['email_cert'];
|
|
||||||
$config['SMTPTimeout'] = 15;
|
|
||||||
$config['mailType'] = 'html';
|
|
||||||
$config['wordWrap'] = true;
|
|
||||||
|
|
||||||
$email->initialize($config);
|
|
||||||
|
|
||||||
$email->setFrom($config['email_address'], $config['email_name']);
|
|
||||||
$email->setTo($recipient);
|
|
||||||
|
|
||||||
$email->setSubject($subject);
|
|
||||||
$email->setMessage($body);
|
|
||||||
|
|
||||||
if (!$email->send()) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (\Exception $ex) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function clonar_tarifa_encuadernacion($teOrigen, $teDestino){
|
private function clonar_tarifa_encuadernacion($teOrigen, $teDestino){
|
||||||
|
|
||||||
$tet_model = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
$tet_model = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
||||||
|
|||||||
Reference in New Issue
Block a user