Get the personalized content of a sent transactional email

Code Examples

You can use as reference the code below to implement this call in your preferred language.
Check all our official API clients here

var Brevo = require('@getbrevo/brevo');
var defaultClient = Brevo.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new Brevo.TransactionalEmailsApi();

var uuid = "uuid_example"; // String | Unique id of the transactional email that has been sent to a particular contact

apiInstance.getTransacEmailContent(uuid).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$uuid = "uuid_example"; // string | Unique id of the transactional email that has been sent to a particular contact

try {
    $result = $apiInstance->getTransacEmailContent($uuid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailsApi->getTransacEmailContent: ', $e->getMessage(), PHP_EOL;
}
?>
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR API KEY'

api_instance = sib_api_v3_sdk.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration))
uuid = '9xxxxxx-1xxx-4xxx-8xx5-3xxxxxxxxxxx'

try:
    api_response = api_instance.get_transac_email_content(uuid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SMTPApi->get_transac_email_content: %s\n" % e)
const SibApiV3Sdk = require('sib-api-v3-typescript');
 
let apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();

let apiKey = apiInstance.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';

let uuid = "79xxxxxx-1xxx-4xxx-8xx5-3xxxxxxxxxxx";

apiInstance.getTransacEmailContent(uuid).then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
  console.error(error);
});
package sibApi;

import sendinblue.ApiClient;
import sendinblue.Configuration;
import sendinblue.auth.ApiKeyAuth;
import sibModel.*;

public class Program {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure API key authorization: api-key
        ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
        apiKey.setApiKey("YOUR API KEY");
        try {
            TransactionalEmailsApi api = new TransactionalEmailsApi();
            String uuid = "79xxxxxx-1xxx-4xxx-8xx5-3xxxxxxxxxxx";
            GetTransacEmailContent response = api.getTransacEmailContent(uuid);
            System.out.println(response.toString());
        } catch (Exception e) {
            System.out.println("Exception occurred:- " + e.getMessage());
        }
    }
}
using sib_api_v3_sdk.Api;
using sib_api_v3_sdk.Client;
using sib_api_v3_sdk.Model;
using System;
using System.Diagnostics;

namespace Sendinblue
{
    class Program
    {
        static void Main(string[] args)
        {
            Configuration.Default.ApiKey.Add("api-key", "YOUR API KEY");

            var apiInstance = new TransactionalEmailsApi();
            string uuid = "79xxxxxx-1xxx-4xxx-8xx5-3xxxxxxxxxxx";
            try
            {
                GetTransacEmailContent result = apiInstance.GetTransacEmailContent(uuid);
                Debug.WriteLine(result.ToJson());
                Console.WriteLine(result.ToJson());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
                Console.WriteLine(e.Message);
                Console.ReadLine();
            }
        }
    }
}
package main
import (
	"fmt"
	"context"
    sib_api_v3_sdk "./lib"
)

func main() {
	var ctx context.Context
	var cli = sib_api_v3_sdk.APIClient{
		cfg: sib_api_v3_sdk.NewConfiguration(),
	}
	//Configure API key authorization: api-key
	cli.cfg.AddDefaultHeader("api-key", "YOUR_API_KEY")

	sib := sib_api_v3_sdk.NewAPIClient(cli.cfg)
	uuid:="xxxxxx-1xxx-4xxx-8xx5-3xxxxxxxxxxx"
	content, resp, err := sib.TransactionalEmailsApi.GetTransacEmailContent(ctx, uuid)
  if err!=nil{
    fmt.Println("Error in GetTransacEmailContent ",err.Error())
    return
  }
	fmt.Println( "GetTransacEmailContent, response:",resp," GetTransacEmailContent object",content)
	return 
}
# load the gem
require 'sib-api-v3-sdk'
# setup authorization
SibApiV3Sdk.configure do |config|
  # Configure API key authorization: api-key
  config.api_key['api-key'] = 'YOUR API KEY'
end

api_instance = SibApiV3Sdk::TransactionalEmailsApi.new

uuid = 'uuid_example' # String | Unique id of the transactional email that has been sent to a particular contact


begin
  #Get the personalized content of a sent transactional email
  result = api_instance.get_transac_email_content(uuid)
  p result
rescue SibApiV3Sdk::ApiError => e
  puts "Exception when calling TransactionalEmailsApi->get_transac_email_content: #{e}"
end

Event names

NameDescription
sentEvent triggered when message is pushed for delivery
deliveredWhen the message reaches the recipient
hard_bounceWhen message is permanently rejected by recipient mail server
soft_bounceWhen message is temporarily rejected by recipients mail server
clickWhen the recipient interacts with the email
openWhen the recipient opens the email
spamWhen email is marked as spam by recipients email provider
blockedWhen an email is prevented to reach the recipients inbox due to blacklisted sender etc.
invalidWhen the senders email is not invalid or does not exist then this event is triggered
unsubscribedThis event is shown when the recipient has unsubscribed from receiving further emails from the sender
deferredThe email delivery has been delayed by the recipients mail server
errorAn error occurred during the mail transfer from sender to recipient
proxy_openAn event where the proxy tells if the email has been opened
invalid_emailWhen the senders email is invalid
Language
Credentials
Header
Click Try It! to start a request and see the response here!