✅ Notificações automáticas com WhatsApp para agendamentos no WordPress grátis
📁 Arquivos disponíveis para download nessa aula
👉 INSTRUÇÕES BÁSICAS VÍDEO 1:
$phoneUser = $appointment[ 'whatsapp' ];
$zdgPhone = preg_replace("/[^0-9]/", "", $phoneUser);
$zdgDDD = substr($zdgPhone,0,2);
$zdgUser = substr($zdgPhone,-8);
if($zdgDDD <= 30){
$zdgWpp = '55' . $zdgDDD . '9' . $zdgUser;
}
if($zdgDDD > 30){
$zdgWpp = '55' . $zdgDDD . $zdgUser;
}
$nome = $appointment[ 'nome' ];
$email = $data[ $email_field ];
$url = 'https://newapi.zapdasgalaxias.com.br/send-message';
$data = array('number' => $zdgWpp, 'message' => $nome . ' seu agendamento realizado com sucesso. Você receberá a confirmação no e-mail: ' . $email);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }