### Example Postback URL with Parameters
Source: https://help.mailercloud.com/en/articles/166-postback-conversion-setup-guide
An example of the postback URL format when sending a conversion event, including the conversion ID and captured tracking parameters.
```text
https://your-domain/postback?conversion_id=aBc&transaction_id=svjYWRSEziWleHwkwdMcChJfdJKEIMvHgKgURblGGARdFBnaMCzF&link_id=79206
```
--------------------------------
### Nested Spintax Example (Not Supported)
Source: https://help.mailercloud.com/en/articles/123-how-to-use-spintax-in-mailercloud
This example shows a nested Spintax structure, which is not supported by the platform. Avoid using multiple layers of brackets and pipes as shown here.
```plaintext
{{Great|Awesome|Fantastic} {job|work}|Keep it up|Well done}, {everyone|team}!
```
--------------------------------
### Campaign List API Response Example
Source: https://help.mailercloud.com/en/articles/165-inbox-tracker-in-api-platform
This is an example of a campaign report response from the Public API, showing inbox placement statistics per provider.
```json
"data": [
{
"campaign_id": "newcam",
"subject": "email subject 100",
"sent": "0",
"opens": "0",
"created_date": "2025-09-22 14:01:34",
"inbox_percentage": 72.41,
"spam_percentage": 23.1,
"missed_percentage": 4.48,
"providers": [
{
"inbox_percentage": "80.00",
"missed_percentage": "5.00",
"name": "gmail",
"spam_percentage": "15.00"
},
{
"inbox_percentage": "0.00",
"missed_percentage": "0.00",
"name": "outlook",
"spam_percentage": "0.00"
},
{
"inbox_percentage": "77.78",
"missed_percentage": "8.89",
"name": "yahoo",
"spam_percentage": "13.33"
},
{
"inbox_percentage": "60.00",
"missed_percentage": "0.00",
"name": "others",
"spam_percentage": "40.00"
}
]
}
]
```
--------------------------------
### Basic Spintax Email Example
Source: https://help.mailercloud.com/en/articles/123-how-to-use-spintax-in-mailercloud
An example of an email using Spintax to create variations in greetings and content. Ensure alternatives are separated by '|' within curly braces {}.
```plaintext
Hi {there|{{Name}}},
I'm reaching out because {I'm interested in your services|I have a question about your
product|I'd like your opinion on something}.Specifically, I was wondering
{what your experience has been with X|if you have any tips for achieving Y|if you could
tell me more about Z}.
If you have a few minutes, I would appreciate the chance to chat. Please let me know if
that's possible.
Thanks and have a great day!
{Regards! |Thanks!}
```
--------------------------------
### Example Original and Redirected Campaign Links
Source: https://help.mailercloud.com/en/articles/166-postback-conversion-setup-guide
Illustrates how Mailercloud appends 'transaction_id' and 'link_id' to original campaign links after a click.
```text
https://www.mailercloud.com/login
```
```text
https://www.mailercloud.com/login?transaction_id=svjYWRSEziWleHwkwdMcChJfdJKEIMvHgKgURblGGARdFBnaMCzF&link_id=79206
```
--------------------------------
### Example Email Review API Request Body
Source: https://help.mailercloud.com/en/articles/156-mailercloud-email-review-api-help-guide
This JSON object contains the required email content parameters for the review API. Provide either text_content, html_content, or amp_content.
```json
{
"text_content": "Welcome to our platform!",
"html_content": "
Welcome!
We are excited to have you.
",
"amp_content": ""
}
```
--------------------------------
### Send Transactional Email using Go
Source: https://help.mailercloud.com/en/articles/134-introduction-to-transactional-emails
Use this Go snippet to send a simple HTML email via SMTP. Ensure you have the gomail.v2 package installed. Replace placeholders with your actual SMTP server details and credentials.
```go
// Package main defines an application that sends a simple HTML email.
package main
import (
"fmt"
"gopkg.in/gomail.v2"
)
func main() {
// Create a new email message.
m := gomail.NewMessage()
// Set essential headers: sender, recipient, and subject.
m.SetHeader("From", "your_email@yourdomain.com")
m.SetHeader("To", "recipient_email@theirdomain.com")
m.SetHeader("Subject", "Welcome to Our Service!")
// Set custom headers for tracking purposes
m.SetHeader("mld-track-opens", "false") // Custom header for open tracking
m.SetHeader("mld-track-inbox", "true") // Custom header for inbox tracking
m.SetHeader("mld-track-campaign-id", "test-node-threshold") // Custom header for campaign ID
// Define the HTML content of the email.
m.SetBody("text/html", `This is a sample email to test SMTP settings`)
// Configure the mail server connection with dummy credentials.
d := gomail.NewDialer("smtp.yourdomain.com", 587, "username@yourdomain.com", "password")
// Send the email, logging errors or success.
if err := d.DialAndSend(m); err != nil {
fmt.Println("Error:", err)
} else {
fmt.Println("Message sent successfully")
}
}
```
--------------------------------
### Webhook Event Triggers and Payloads
Source: https://help.mailercloud.com/en/articles/132-getting-started-with-webhooks
This section details the various event triggers available for Mailercloud webhooks and provides examples of the JSON payloads sent for each event.
```APIDOC
## Event Triggers
Webhooks can be triggered by the following triggered events: **send, open, click, fail, spam, unsubscribe and bounce.**
### 1. Sent Event
This trigger is sent as a batch of up to 1000 emails.
**Payload Example:**
```json
{
"event": "Campaign Sent",
"emails": ["****sample@gmail.com****", "****sample2@gmail.com****"],
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"date_sent": "2024-01-01 01:30:00",
"ts": 1604937111,
"ts_event": 1604937111
}
```
**Parameters:**
* `event` (string) - Indicates the type of event, e.g., "Campaign Sent".
* `emails` (array of strings) - An array of email addresses that were sent the campaign.
* `campaign_name` (string) - The name of the campaign that was sent.
* `tag_name` (string) - The tag associated with the campaign.
* `campaign_id` (string) - The unique identifier of the campaign.
* `date_sent` (string) - The date and time when the campaign was sent.
* `ts` (integer) - A timestamp representing the date and time in Unix format.
* `ts_event` (integer) - A timestamp specifically for the event, also in Unix format.
### 2. Open Event
**Payload Example:**
```json
{
"event": "Opened",
"email": "sample@gmail.com",
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"date_event": "2024-01-01 01:30:00",
"ts": 1604937111,
"ts_event": 1604937111
}
```
**Parameters:**
* `event` (string) - Indicates the type of event, e.g., "Opened".
* `email` (string) - The email address of the recipient who opened the email.
* `campaign_name` (string) - The name of the campaign associated with the opened event.
* `tag_name` (string) - The tag associated with the campaign.
* `campaign_id` (string) - The unique identifier of the campaign.
* `date_event` (string) - The date and time when the event (opening) occurred.
* `ts` (integer) - A timestamp representing the date and time in Unix format.
* `ts_event` (integer) - A timestamp specifically for the event, also in Unix format.
### 3. Click Event
**Payload Example:**
```json
{
"event": "Clicked",
"email": "sample@gmail.com",
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"URL": "clicked_url.com",
"date_event": "2024-01-01 01:30:00",
"ts": 1604937111,
"ts_event": 1604937111
}
```
**Parameters:**
* `event` (string) - Indicates the type of event, e.g., "Clicked".
* `email` (string) - The email address of the recipient who clicked on the link.
* `campaign_name` (string) - The name of the campaign associated with the clicked event.
* `tag_name` (string) - The tag associated with the campaign.
* `campaign_id` (string) - The unique identifier of the campaign.
* `URL` (string) - The URL that was clicked by the recipient.
* `date_event` (string) - The date and time when the event (clicking) occurred.
* `ts` (integer) - A timestamp representing the date and time in Unix format.
* `ts_event` (integer) - A timestamp specifically for the event, also in Unix format.
### 4. Fail Event
**Payload Example:**
```json
{
"event": "Campaign Failed",
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"date_event": "2024-01-01 01:30:00",
"reason": "No sender id",
"ts": 1604937111,
"ts_event": 1604937111
}
```
**Parameters:**
* `event` (string) - Indicates the type of event, e.g., "Campaign Failed".
* `campaign_name` (string) - The name of the campaign that failed to deliver.
* `tag_name` (string) - The tag associated with the campaign.
* `campaign_id` (string) - The unique identifier of the campaign.
* `date_event` (string) - The date and time when the failure event occurred.
* `reason` (string) - Provides the reason for the failure.
* `ts` (integer) - A timestamp representing the date and time in Unix format.
* `ts_event` (integer) - A timestamp specifically for the event, also in Unix format.
**Note:** Payloads for 'Spam', 'Unsubscribe', and 'Bounce' events are similar in structure to the 'Fail Event', with specific `event` types and potentially additional relevant fields.
```
--------------------------------
### Send Postback Request on Conversion Event
Source: https://help.mailercloud.com/en/articles/166-postback-conversion-setup-guide
JavaScript code using the Fetch API to send a GET request to the postback URL with stored transaction and link IDs when a conversion occurs.
```javascript
const conversionId = 'aBc'; // Your Conversion ID
const transactionId = localStorage.getItem('transaction_id');
const linkId = localStorage.getItem('link_id');
if (transactionId && linkId) {
const postbackUrl = `https://your-domain/postback?conversion_id=${conversionId}&transaction_id=${transactionId}&link_id=${linkId}`;
fetch(postbackUrl)
.then(response => console.log('Conversion tracked:', response.status))
.catch(error => console.error('Error tracking conversion:', error));
}
```
--------------------------------
### Example AMP Error Response from Email Review API
Source: https://help.mailercloud.com/en/articles/156-mailercloud-email-review-api-help-guide
This response format is returned when AMP validation errors are detected in the email content. It details the specific errors found.
```json
{
"error": "AMP validation errors",
"validation_errors": [
{
"line": 1,
"position": 15,
"message": "The mandatory attribute '⚡4email' is missing in tag 'html'."
},
{
"line": 1,
"position": 49,
"message": "The attribute 'http-equiv' may not appear in tag 'meta'."
}
]
}
```
--------------------------------
### Success Response Example for Email Review
Source: https://help.mailercloud.com/en/articles/156-mailercloud-email-review-api-help-guide
A successful response from the Email Review API indicating no critical issues. It may include details on broken links, blacklisted domains, and email template size.
```json
{
"broken_links": ["example.com"],
"blacklist_domains": [
{
"target_domain": "example.com",
"target_ip": "160.0.232.217",
"results": [
{
"blacklist": "blacklist.net",
"status": "listed",
"details": "addresses: [127.0.0.2]"
}
]
}
],
"template": {
"total_size": "809 bytes",
"html_template_size": "500 bytes",
"text_template_size": "309 bytes"
}
}
```
--------------------------------
### Mailercloud Click Event Webhook Payload
Source: https://help.mailercloud.com/en/articles/132-getting-started-with-webhooks
Example payload for the 'Clicked' webhook trigger, including the URL that was clicked.
```json
{
"event": "Clicked",
"email": "sample@gmail.com",
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"URL": "clicked_url.com",
"date_event": "2024-01-01 01:30:00",
"ts": 1604937111,
"ts_event": 1604937111
}
```
--------------------------------
### Spintax for Multiple Text Variations
Source: https://help.mailercloud.com/en/articles/123-how-to-use-spintax-in-mailercloud
Demonstrates how to generate diverse text outputs by combining multiple Spintax elements. Each set of alternatives within braces {} can be independently varied.
```plaintext
{Hello|Hi|Hey} {world|everyone|guys}
```
--------------------------------
### Mailercloud Open Event Webhook Payload
Source: https://help.mailercloud.com/en/articles/132-getting-started-with-webhooks
Example payload for the 'Opened' webhook trigger, detailing recipient and campaign information.
```json
{
"event": "Opened",
"email": "sample@gmail.com",
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"date_event": "2024-01-01 01:30:00",
"ts": 1604937111,
"ts_event": 1604937111
}
```
--------------------------------
### Mailercloud Fail Event Webhook Payload
Source: https://help.mailercloud.com/en/articles/132-getting-started-with-webhooks
Example payload for the 'Campaign Failed' webhook trigger, specifying the reason for failure.
```json
{
"event": "Campaign Failed",
"campaign_name": "Sample Campaign",
"tag_name": "Sample Tag",
"campaign_id": "abc",
"date_event": "2024-01-01 01:30:00",
"reason": "No sender id",
"ts": 1604937111,
"ts_event": 1604937111
}
```
--------------------------------
### Capture and Store Tracking Parameters on Landing Page
Source: https://help.mailercloud.com/en/articles/166-postback-conversion-setup-guide
JavaScript code to extract 'transaction_id' and 'link_id' from the URL and store them in localStorage.
```javascript
const urlParams = new URLSearchParams(window.location.search);
const transactionId = urlParams.get('transaction_id');
const linkId = urlParams.get('link_id');
if (transactionId && linkId) {
localStorage.setItem('transaction_id', transactionId);
localStorage.setItem('link_id', linkId);
}
```