I want to send an email through the class Cake\Mailer\Email;
and when inserting a link <a href="url"></a>
insert another url that includes the transport host configured in bootstrap.php
My action on the controller:
$email = new Email();
$email
->setTemplate('credito_generado')
->setEmailFormat('html')
->setTo($email)
->setCc(EMAIL_SALIENTE)
->setSubject('Credito generado')
->setViewVars([
'c_nombre' => $nombre,
'c_paterno' => $apellido_paterno,
'c_materno' => $apellido_materno,
'c_plazo' => $plazo,
'c_monto' => number_format($total, DECIMALES),
'c_id' => $id
]);
$result_email = $email->send();
$this->log('RESULT_EMAIL: '.print_r($result_email, true), LogLevel::DEBUG);
In src \ Template \ Email \ html \ vista.ctp I only print the variables and a link with:
<a href="<?= \Cake\Routing\Router::fullBaseUrl().'/nexumclub/creditos/tabla-pdf/'.$c_id ?>">VER</a>