params; $wab = null; if(isset($params["wab"])) { $wab = $params["wab"]; } if($wab === null) { $this->stdout("No existe la configuración\n"); } $msgTo = "526621115643"; $template = "laud_resumen_eventos"; $template = "informe_de_eventos"; $eventos = "5/5 eventos"; $mensaje = "gracias por tu "; try { $wa = (new Whatsapp()) ->set_access_token($wab["access-token"]) ->msg_from($wab["phone-id"]) ->msg_to($msgTo) ->template($template) ->add_body_param($eventos) ->add_body_param($mensaje) ->send_template_message(); if($wa === null) { $this->stdout("Ocurrió un error al enviar el mensaje\n"); return; } $this->stdout("Proceso terminado\n"); } catch (\Exception $e) { $this->stdout("Error al enviar el mensaje: {$e->getMessage()}\n"); } } }