1. Go to this page and download the library: Download softan/mailing-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use SoftanMailing\Services;
$result = Services::sendByTemplate([
'template_key' => 'tpl_1234567890_ab12', // Clave del template (tpl_...)
'recipient_email' => '[email protected]',
'recipient_name' => 'Juan Pérez',
'email_params' => [ // Mapa clave-valor con los parámetros del template
'name' => 'Juan',
'code' => '998877',
],
]);
use SoftanMailing\SDK;
use SoftanMailing\Services;
// Forzar entorno prod (llamar antes del primer Services::*)
SDK::$META = SDK::loadJson(SDK::META_PATH);
SDK::$CONFIG = ['active_environment' => 'prod'];
// Todas las llamadas siguientes usarán prod
$result = Services::sendByTemplate([...]);
Services::sendByTemplate($payload, null, false); // tercer parámetro: $verifyTLS