Exemplo n.º 1
0
 public function sendInvitacion($datos)
 {
     if (!(isset($datos['email']) && isset($datos['nombres']) && isset($datos['apellidos']) && isset($datos['titulo']) && isset($datos['fchInicio']) && isset($datos['fchFin']))) {
         $this->estado = false;
         $this->mensaje = 'Faltan datos para el envío del correo';
         return $this->estado;
     }
     $html = false;
     if (isset($datos['codigo'])) {
         $html = Vistas::getMailInvitacionNew($datos);
     } else {
         $html = Vistas::getMailInvitacionUser($datos);
     }
     if (!$html) {
         $this->estado = false;
         $this->mensaje = 'Error al cargar plantilla';
         return $this->estado;
     }
     try {
         $mail = $this->createMail();
         $mail->Subject = 'Tiene una invitació en entrevistaDO';
         $mail->msgHTML($html);
         $mail->addAddress($datos['email'], $datos['nombres']);
         if ($mail->send()) {
             $this->estado = true;
             $this->mensaje = 'Correo enviado';
         } else {
             $this->estado = false;
             $this->mensaje = 'Error al enviar correo';
             $this->detalle = $mail->ErrorInfo;
         }
     } catch (Exception $ex) {
         $this->estado = false;
         $this->mensaje = 'Error al enviar correo';
         $this->detalle = $ex->getMessage();
     }
     return $this->estado;
 }
Exemplo n.º 2
0
 public static function getMailInvitacionNew($datos)
 {
     $url = 'mailInvitacionNew.html';
     return Vistas::rederTemplate($url, $datos);
 }