Overview

Use this method to send a preview email to a specific email address. You must specify the ID of the email you want to preview, and the email address of the recipient you want the system to send the preview to.

The Method

API-Method
RESTPOSThttps://[Your URL]/api/2.0/email_preview/:id/:recipient
XML-RPCCallemails.PreviewEmail

Your method must be structured as follows:

Parameters

Required Parameters

The following parameters are required for this method to work:

PropertyTypeDescriptionRequired
$idintegerThe ID of the email to create a preview of.yes
$recipientstringThe email address of the person to which the preview must be sent.yes

Responses

TypeDescription
booleanIf the preview was successful or not.

Code Samples

PHP (using REST API):

$recipient = '[email protected]';
$url = '(Your URL)/api/2.0/email_actions/email_preview/:email_id/' . $recipient;
$method = 'POST';
$cSession = curl_init();
$headers = array();
$auth = base64_encode($username . ':' . $apikey);
$headers[] = 'Authorization: Basic ' . $auth;
curl_setopt($cSession, CURLOPT_URL, $url);
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));
curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($cSession);
curl_close($cSession);