Preview a mailing, this will give you the HTML and/or TEXT
version of the selected mailing.
The following errors can occur:
- Token not present in request.
- Token not in the required format.
- Session does not exist.
- Session has expired.
- The user does not exist.
- No database specified.
- Database parameter not in correct format.
- You are not allowed to access this database.
- The mail parameter is required.
- The mail parameter has the wrong format.
- The selected mail does not exist.
You should call this function as followed:
- rest/v2/statistics/subscribers?token=TOKEN&database=DATABASE_ID&mail=MAIL_ID
require_once 'Rest.php';
$username = 'my_username';
$password = 'my_password';
$database = '999';
$rest = new Rest($username, $password, $database);
$result = $rest->call('mail/preview', [
'mail' => 'MAIL_ID'
], 'GET');
var_dump($result);
The following parameters this method can/should be called with:
key: mail
values: integer
what: The id of the mail you want to preview.
key: categories
values: integer
what: id's of the categories you want to see the preview with
The following items:
- user/login For the TOKEN.
- user/database For the DATABASE_ID
- mail/availables For the MAIL_ID