Use the official isend.ai PHP SDK to send emails with templates via your favorite email provider.
composer require isend-ai/php-sdk
dataMapping
<?php require_once 'vendor/autoload.php'; use ISend\ISendClient; // Initialize the client with your API key $client = new ISendClient('your-api-key-here'); // Prepare email data $emailData = [ 'template_id' => 124, 'to' => 'hi@isend.ai', 'dataMapping' => [ 'name' => 'ISend' ] ]; // Send the email $response = $client->sendEmail($emailData); print_r($response);
try { $response = $client->sendEmail([ 'template_id' => 124, 'to' => 'hi@isend.ai', 'dataMapping' => [ 'name' => 'ISend' ] ]); } catch (Exception $e) { echo "Error: " . $e->getMessage(); }