Track Replies to Emails Sent by an ETL Workflow
To track replies to sent emails, store the original Message-ID with the relevant business record, then compare it with the message identifiers in the reply’s In-Reply-To value. Advanced ETL Processor exposes both fields in the relevant send and mailbox-loop actions, so an invoice reply does not have to rely on a subject line behaving like a primary key. It will not.
Why the email subject is not enough
Email subjects are useful labels, not reliable identifiers. A recipient can edit the subject, mail software can add or remove prefixes such as Re:, and two unrelated messages can use exactly the same wording.
A unique Message-ID is the safer tracking key. Keep the subject for people and reports. Use the message identifier for database matching.
How email reply tracking works
Every outgoing email should have a unique Message-ID. The Send Email action exposes its Message ID through a variable, which the workflow can write into a database.
- Generate and send the outgoing email.
- Capture its
Message-ID. - Store the
Message-IDwith the customer, invoice, order, ticket, or workflow record. - Receive the customer’s reply.
- Read the reply’s
In-Reply-Tovalue and parse each message identifier it contains. - Find the original record whose outgoing
Message-IDmatches any parsed identifier. - Update the record or trigger the next workflow step.
Current Advanced ETL Processor Enterprise releases expose In-Reply-To in the IMAP4 Email Loop and Office 365 Email Loop. This confirmed support does not extend the claim to POP3 or other receive actions.
For the underlying standard, see RFC 5322 section 3.6.4. Microsoft also documents message internet headers in its Graph message resource.
Recommended database fields
Use a small email log table and index the outgoing identifier. The exact field names can be adapted to your database and naming standards.
| Field | Purpose |
|---|---|
EmailLogID | Primary key for the email log row. |
BusinessRecordID | Links the message to the invoice, order, ticket, approval, or customer record. |
RecipientAddress | Records the address used for the outgoing message. |
Subject | Keeps a readable label for support and reporting, but is not the matching key. |
SentDateTime | Records when the outgoing message was sent. |
OutgoingMessageID | Stores the unique Message-ID returned after sending. |
IncomingMessageID | Stores the reply’s own Message-ID for auditing and duplicate handling. |
InReplyToMessageID | Stores the original Message-ID referenced by the incoming reply. |
ReplyReceivedDateTime | Records when the response reached the monitored mailbox. |
Status | Tracks states such as Sent, Replied, Approved, Rejected, or Review Required. |
Create the SQL Server email log table
This table stores the business identifiers, archived message path, outgoing or incoming Message-ID, and the identifier referenced by a reply. SQL Server generates ID and applies the current date when EMAIL_DATE is omitted.
CREATE TABLE [dbo].[EMAIL_LOG](
[ID] [int] IDENTITY(1,1) NOT NULL,
[EMAIL_TYPE] [varchar](150) NULL,
[EMAIL_DATE] [date] NULL,
[ORG_CODE] [varchar](50) NULL,
[NATIONAL_CODE] [varchar](50) NULL,
[INVOICE_NUMBER] [varchar](50) NULL,
[FILE_NAME] [varchar](250) NULL,
[MESSAGE_ID] [varchar](250) NULL,
[IN_REPLY_TO] [varchar](250) NULL,
CONSTRAINT [PK_EMAIL_LOG] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EMAIL_LOG] ADD CONSTRAINT [DF_EMAIL_LOG_EMAIL_DATE] DEFAULT (getdate()) FOR [EMAIL_DATE]
GO The date type stores the calendar date without a time of day. Change the column type before production if the audit trail needs the precise arrival time.
Clean the incoming Message-ID for the archive filename
The reply workflow uses a calculated Pascal variable named #CustomMessageID#. It removes the angle brackets and the demonstrated mail domain from the incoming message’s own #MessageID#:
begin
Result:=Replace(GetVariable('#MessageID#'),'<','');
Result:=Replace(Result,'>','');
Result:=Replace(Result,'@etl-tools.com','');
end; The cleaned value is used in the archive path #Folder#\#CustomMessageID#.eml. Replace @etl-tools.com with the domain returned by your mail server and remove any other characters your storage platform rejects.
Do not replace the database matching value with this filename version. Store the original incoming #MessageID#, and compare each identifier from #In-Reply-To# with the original outgoing MESSAGE_ID. Apply the same normalization to both sides only if your database design deliberately removes brackets or changes case.
Example business uses
- Match a customer reply to an invoice.
- Attach a supplier response to a purchase order.
- Update a support or service request.
- Track approval and rejection emails.
- Continue an automated workflow when a reply arrives.
Video: Track Replies to Emails Sent by an ETL Workflow
Watch Track Replies to Emails Sent by an ETL Workflow on YouTube.
Why use Advanced ETL Processor
- Self-hosted processing: Mailbox credentials, message data, and business records remain on infrastructure you control.
- Email and database steps in one workflow: Send, receive, compare identifiers, and update the record without a separate integration service.
- Scheduled and unattended execution: Monitor replies on a schedule instead of depending on someone checking a mailbox.
- Logging and auditability: Retain message identifiers, dates, matching results, and workflow status.
- Unlimited executions: Run the workflow without per-message or per-execution fees.
- Direct technical support: Ask the people who build the product when a mail server decides standards are merely suggestions.
Getting started
- Start with the email sending workflow guide and configure a test message.
- Create the email log table and write the outgoing Message ID variable beside a real test record.
- Use an IMAP4 or Office 365 Email Loop to read the reply, parse its
In-Reply-Toidentifiers, and compare them with the stored value. - Update the business record only when the identifier matches. Send unmatched replies to a review queue rather than guessing from the subject.
- Review the Advanced ETL Processor Enterprise features and get the installer from the ETL Tools trial downloads.
If one person sends a handful of messages and handles every reply manually, this may be more workflow than you need. Build it when the reply must update a database, preserve an audit trail, or continue an unattended process.
Related email automation guides
Return to the Email Automation hub for attachment, reporting, Microsoft 365, and mailbox-processing guides.
FAQ
How does an email client know that a message is a reply?
A reply normally includes an In-Reply-To header containing one or more Message-ID values for messages being answered. Email clients use those values, and often the References header, to place messages in the same conversation.
What is a Message-ID?
A Message-ID is a globally unique identifier assigned to an email message. Store the outgoing value with the related business record so a later reply can be linked back to it.
What is the In-Reply-To header?
In-Reply-To is an email header that contains one or more Message-ID values identifying messages being answered. Advanced ETL Processor exposes this value through its IMAP4 Email Loop and Office 365 Email Loop actions.
Can I track replies using the subject line?
Do not use the subject as the tracking key. Recipients can edit it, automated systems can add prefixes, and unrelated messages can share the same subject.
Should Message-ID values be stored with angle brackets?
Store the value exactly as the workflow exposes it, including angle brackets when present. If your database normalizes the value, apply the same normalization to both Message-ID and In-Reply-To before comparing them.
Can Advanced ETL Processor store sent-email information in a database?
Yes. A workflow can capture the outgoing Message ID variable and write it with recipient, date, subject, business key, and status fields in a database.
Can I test the workflow before buying?
Yes. The fully functional trial runs for 30 days. Test the process with a mailbox and a small database table before scheduling it for production.
Build a Traceable Email Workflow
Download the fully functional 30-day trial and test the process with your own mailbox and database.
Direct link, no registration required.