Tu lista de correos es el mejor recurso digital que tu negocio puede tener.
Pero en muchas ocasiones tu lista puede crecer y tu estar pagando por contactos que no abren o leen tus publicaciones.
En este vídeo te voy a explicar cómo puedes borrar un contacto de ActiveCampaign sin que sepas programar y lo puedas hacer de acuerdo a reglas que tu definas.
Te comparto el código para tu Webhook
<?php
// Automatiza tu negocio con Herramientas NoCode o LowCode delete.php?secret=CLAVE
// ActiveCampaign url & API Key
$url = '';
$api_key = '';
$secret_key = 'CLAVE'; // palabra clave para borrar contactos a través de Webhook sólo letras y números
/***** do NOT edit below this line *****/
/*****
* functions
*
*****/
function go_curl($id, $api_action)
{
global $url, $api_key;
if ($api_action == "contact_delete")
{
$params = array(
'api_key' => $api_key,
'api_action' => $api_action,
'api_output' => 'serialize',
'id' => $id,
);
}
$query = "";
if (!empty($params)) foreach( $params as $key => $value ) $query .= urlencode($key) . '=' . urlencode($value) . '&';
$query = rtrim($query, '& ');
$data = "";
if (!empty($post)) foreach( $post as $key => $value ) $data .= urlencode($key) . '=' . urlencode($value) . '&';
$data = rtrim($data, '& ');
$url = rtrim($url, '/ ');
if ( !function_exists('curl_init') ) die('CURL not supported.');
if ( $params['api_output'] == 'json' && !function_exists('json_decode') ) {
die('JSON not supported. (introduced in PHP 5.2.0)');
}
$api = $url . '/admin/api.php?' . $query;
$request = curl_init($api);
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $data);
curl_setopt($request, CURLOPT_FOLLOWLOCATION, true);
$response = (string)curl_exec($request);
curl_close($request);
if ( !$response ) {
die('Nothing was returned. Do you have a connection to Email Marketing server?');
}
return $response;
}
$id = trim(strip_tags($_POST['contact']['id']));
$secret = trim(strip_tags($_GET['secret']));
$api_action = 'contact_delete';
if ($id > 0 && $secret === $secret_key && $secret_key != "") $result = unserialize(go_curl($id, $api_action));
Recursos del vídeo
🟡 ActiveCampaign: gnb.mx/activecampaign
🟡 Automatización Borrar Contacto AC: https://tplshare.com/782RU49
🟡 Automatización Actividad en mi lista: https://tplshare.com/782RU49
🟡 Automatización Espera Engagement: https://tplshare.com/$A852wz