Read mailing template merge options
Returns organization programs excluding the synthetic root, form-aware merge schema, Unlayer tag groups and a latest-record preview context. scope_type defaults donor; program_ids narrows form groups, while preview context independently selects the latest suitable record. No mailing is generated. Requires permission: one of mailings_view, mailings_generate, mailings_manage, manage_email, reports_view, reports_manage.
curl --request GET \
--url https://api.gratona.com/v1/admin/mailing_templates/meta/options \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gratona.com/v1/admin/mailing_templates/meta/options"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gratona.com/v1/admin/mailing_templates/meta/options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/mailing_templates/meta/options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/mailing_templates/meta/options"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gratona.com/v1/admin/mailing_templates/meta/options")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/mailing_templates/meta/options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"available_programs": [
{
"id": 42,
"name": "Example"
}
],
"merge_schema": [
{
"key": "donor",
"name": "Donor",
"merge_tags": {},
"form_category": "donor",
"form_id": 42,
"form_name": "Example",
"program_ids": [
42
],
"program_names": [
"Example"
],
"use_standardized_fields": true
}
],
"merge_tags": {},
"preview_context": {
"preview_type": "donor",
"donor_id": 42,
"donor_entity_id": 42,
"trip_participant_id": 42,
"entity_id": 42,
"donor_hysform_id": 42,
"entity_hysform_id": 42,
"merge_data": {
"organization_name": "Example",
"organization_email": "jsmith@example.com",
"organization_website": "Example",
"organization_phone": "Example",
"base_currency": "Example",
"organization_timezone": "Africa/Kampala",
"donor_id": 42,
"donor_name": "Example",
"donor_email": "<string>",
"email": "<string>",
"username": "Example",
"recipient_name": "Example",
"household_id": 42,
"donor_entity_id": 42,
"entity_id": 42,
"program_id": 42,
"program_name": "Example",
"commitment_id": 42,
"sponsorship_amount": 123,
"sponsorship_frequency": "Example",
"sponsorship_start_date": "Example",
"last_payment_date": "Example",
"next_payment_date": "Example",
"generated_date": "10/20/2026",
"generated_datetime": "Example",
"year": 2026
}
}
}
}{
"message": "Unauthorized",
"status": "error"
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Query Parameters
donor/sponsorship/household scope, or tax_summary to list only the system tax-summary template.
Optional program ids; bound templates apply only when every selected program is in their bindings.
Organization-owned record identifier.
Response
Operation result.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.gratona.com/v1/admin/mailing_templates/meta/options \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gratona.com/v1/admin/mailing_templates/meta/options"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gratona.com/v1/admin/mailing_templates/meta/options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/mailing_templates/meta/options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/mailing_templates/meta/options"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gratona.com/v1/admin/mailing_templates/meta/options")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/mailing_templates/meta/options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"available_programs": [
{
"id": 42,
"name": "Example"
}
],
"merge_schema": [
{
"key": "donor",
"name": "Donor",
"merge_tags": {},
"form_category": "donor",
"form_id": 42,
"form_name": "Example",
"program_ids": [
42
],
"program_names": [
"Example"
],
"use_standardized_fields": true
}
],
"merge_tags": {},
"preview_context": {
"preview_type": "donor",
"donor_id": 42,
"donor_entity_id": 42,
"trip_participant_id": 42,
"entity_id": 42,
"donor_hysform_id": 42,
"entity_hysform_id": 42,
"merge_data": {
"organization_name": "Example",
"organization_email": "jsmith@example.com",
"organization_website": "Example",
"organization_phone": "Example",
"base_currency": "Example",
"organization_timezone": "Africa/Kampala",
"donor_id": 42,
"donor_name": "Example",
"donor_email": "<string>",
"email": "<string>",
"username": "Example",
"recipient_name": "Example",
"household_id": 42,
"donor_entity_id": 42,
"entity_id": 42,
"program_id": 42,
"program_name": "Example",
"commitment_id": 42,
"sponsorship_amount": 123,
"sponsorship_frequency": "Example",
"sponsorship_start_date": "Example",
"last_payment_date": "Example",
"next_payment_date": "Example",
"generated_date": "10/20/2026",
"generated_datetime": "Example",
"year": 2026
}
}
}
}{
"message": "Unauthorized",
"status": "error"
}