How OutboundSync formats Email Replies in HubSpot
Last updated December 17, 2025
Overview
This article explains how OutboundSync processes and formats email replies before syncing them into HubSpot. The goal of our approach is to maximize data retention and reliability, even if that sometimes comes at the expense of perfect readability.
High-Level Philosophy
When syncing email data into HubSpot, OutboundSync intentionally errs on the side of preserving as much original data as possible.
As a guiding principle:
The problem is the myriad of characters that can create issues, break the API call, and result in data loss. We have erred on the side of getting the data into HubSpot.
Because of this, our formatting and cleanup logic is conservative. We avoid aggressive sanitization or transformations that could result in truncated payloads, failed API calls, or lost message content.
Source Payload (example shown: Smartlead – EMAIL_REPLY)
OutboundSync consumes the EMAIL_REPLY event payload from the sequencer. The relevant structure includes both html and text representations of the message:
{ event_type: 'EMAIL_REPLY';
subject: string;
to_name: string;
to_email: string;
from_email: string;
campaign_name: string;
campaign_id: string;
sl_email_lead_id: string;
client_id: string;
message_id: string;
sent_message: {
text: string;
html: string;
message_id: string;
};
reply_message: {
html: string;
text: string;
message_id: string;
};
sequence_number: string;
stats_id: string;
event_timestamp: string;
}Which Fields We Use in HubSpot
Primary Field: reply_message.html
- OutboundSync formats and syncs the
reply_message.htmlfield when creating Email Reply records in HubSpot. - This field is regenerated/formatted each time to ensure consistency.
Deprecated Field: reply_message.text
- We no longer rely on
reply_message.textas the primary source of truth. - Earlier implementations used this field, but it was found to be unreliable.
Why we stopped using reply_message.text:
- In some cases, the payload would be cut off or truncated.
- This resulted in partial email replies being synced, which is worse than reduced legibility.
To prevent this, we now prefer HTML-based syncing whenever possible.
Handling Missing HTML in the Payload
While reply_message.html is our preferred field, the payload does not always populate it.
Current Fallback Logic
- The EMAIL_REPLY payload includes both
htmlandtextfields. - In some cases:
reply_message.htmlis emptyreply_message.textcontains the full message
When this happens:
- OutboundSync detects the empty
htmlfield - We fall back to using
reply_message.text - The text content is used to ensure the reply is still fully captured and synced
This logic ensures we do not drop replies simply because HTML content is missing.
Why Formatting May Look "Messy" in HubSpot
Some email replies in HubSpot may contain:
- Extra line breaks
- Inline styles or raw HTML
- Unescaped or unusual characters
This is expected behavior.
We intentionally avoid aggressive cleanup because:
- Certain characters can break HubSpot API calls
- Over-sanitization increases the risk of data loss
- Retaining the full message is more valuable than perfect presentation
Summary
- OutboundSync prioritizes data completeness and reliability over visual polish
reply_message.htmlis the primary field used for Email Reply formattingreply_message.textis only used as a fallback when HTML is missing- Conservative formatting helps prevent truncation, API failures, and lost email content
If you see formatting artifacts in HubSpot, it is usually a sign that OutboundSync successfully preserved the full reply rather than risking partial data.

