Hulo Global home
For Vendure Vendure edition: for Vendure 3.5+ shops, installed with npm. Also available for WordPress: Email Tracking for WordPress
For Vendure

Email Tracking for Vendure: user manual

Overview

Email Tracking logs every transactional email your Vendure server sends. It wraps the @vendure/email-plugin sender, so opens and clicks are tracked without per-handler wiring, and your own plugin code can send through EmailTrackingService for the same tracking.

What it records:

  • Each send: recipient, subject, type, the related order, customer and invoice, the SMTP reply and Message-ID, in the email_log table.
  • Every event, raw: one email_event row per send, delivery, deferral, bounce, complaint, unsubscribe, open and click, never deduplicated, with its source, time, hashed IP, approximate location, email client and classification.
  • Classification: each open and click is human_likely, machine_likely or unknown, with reason codes such as gmail-proxy, ampp (Apple Mail Privacy Protection), safelinks and bot-ua. It is advisory: nothing is blocked.
  • Delivery from your provider: Postmark, SendGrid, Mailgun and Amazon SES webhooks, each verified with the provider's own signature scheme.
  • Bounces and complaints: a status update, and for hard bounces and complaints the address joins the suppression list, which every later email is checked against at send.

The log, opens and clicks, the suppression list, bounces and complaints, each order's email list and the customer Emails tab are free; per-template rates, CSV export, the order activity timeline with the PDF evidence report, and provider delivery, deferral, unsubscribe and engagement events need a licence (see Free and licensed).

Release notes for every version are on the changelog page.

Install

One package, one line of config, and one new table. The fastest way is the bundled installer:

curl -sSL https://huloglobal.com/vendure-plugins/email-tracking/install.sh | bash

Or by hand:

# 1. Install yarn add @huloglobal/vendure-plugin-email-tracking # 2. Register in vendure-config.ts import { EmailTrackingPlugin, TrackingEmailSender } from '@huloglobal/vendure-plugin-email-tracking'; export const config: VendureConfig = { plugins: [ EmailTrackingPlugin.init({ publicBaseUrl: 'https://shop.example.com', licenceKey: process.env.HULO_LICENCE_KEY_EMAIL_TRACKING, bounceWebhookSecret: process.env.HULO_BOUNCE_WEBHOOK_SECRET, // optional }), // also pass TrackingEmailSender to the @vendure/email-plugin: EmailPlugin.init({ emailSender: new TrackingEmailSender(), // ... your existing email-plugin options ... }), ], }; # 3. Generate + run the migration yarn migration:generate AddEmailTrackingTables yarn migration:run

Restart Vendure and compile the admin UI. The Email Log page appears under Customers, every order page gets an Email activity panel, and every customer page an Emails tab.

Upgrading to 0.17: one new column, email_log.machineCount (int, default 0). With synchronize: false, generate a migration or add it with the DDL in the package README ("Upgrading to 0.17.0") before upgrading.
Upgrading from 0.15.x: 0.16 adds one table, email_event. With synchronize: false, generate a migration or run the DDL in the package README ("Upgrading to 0.16.0"). Until the table exists the plugin keeps working as 0.15.4 and logs a warning.

Admin UI tour

The Email Log page is mounted at /admin/extensions/email-log (Customers → Email Log).

Email Log — list view Admin panel mockup. Status totals — All 1247 / Sent 1198 / Failed 12 / Deferred 8 / Bounced 14 / Opens 540 / Clicks 87 — Filters — Input: Filter recipient… — Input: Filter type… — Recent emails — #1247 29 May order-confirmation alice@example.com Sent ●●● 12 opens, 3 clicks — #1246 29 May password-reset bob@example.com Sent ● 1 open, 0 clicks — #1245 28 May invoice carol@example.com Sent ●●●● 8 opens, 2 clicks Vendure Admin Email Log — list view Status totalsAll 1247 Sent 1198 Failed 12 Deferred 8 Bounced 14 Opens 540 Clicks 87 Filters Filter recipient… Filter type… Recent emails#1247 29 May order-confirmation alice@example.com Sent ●●● 12 opens, 3 clicks#1246 29 May password-reset bob@example.com Sent ● 1 open, 0 clicks#1245 28 May invoice carol@example.com Sent ●●●● 8 opens, 2 clicks
List view — colour-coded status pills, per-row open/click counts, click any row for the timeline.

Click Details on any row to expand it. You'll see:

  • Header block: from, to, BCC, subject and context
  • SMTP block: Message-ID, SMTP reply and any error
  • Open and click history: every open and click with its time, approximate location, email client and classification

Order activity

Every order page shows an Email activity panel with a summary and the latest events. Open full activity leads to the order's timeline, which merges the order's email events with Vendure's own order history: state changes, payments, fulfilments, refunds, cancellations and notes. Filter by emails, opens, clicks, delivery, order and payment, or notes; the page loads 100 events at a time, with Load more. The buttons export a CSV, open the PDF evidence report and, for roles with the ExportEmailEvidence permission, a full JSON export.

Customer Emails tab

Every customer page gets an Emails tab: what was sent to that customer, with links to each order and its activity.

IP-derived locations are approximate and may show a mail proxy, VPN or security scanner rather than the customer. Machine-likely opens are often privacy proxies or scanners.

Provider delivery webhooks

Point your email provider's event webhook at your own server, and the plugin records deliveries, deferrals, bounces, drops, complaints and unsubscribes from it. Each provider has its own URL and is verified with its own signature scheme:

ProviderURLHow it is verified
Postmark/email-track/webhook/postmarkHTTP Basic auth with the username and password you set
SendGrid/email-track/webhook/sendgridSigned Event Webhook: ECDSA over the timestamp and the exact request body
Mailgun/email-track/webhook/mailgunHMAC-SHA256 with your webhook signing key, a timestamp window and a replay check
Amazon SES/email-track/webhook/sesThe SNS message signature, checked against Amazon's certificate, and your topic ARN
EmailTrackingPlugin.init({ publicBaseUrl: 'https://shop.example.com', providerWebhooks: { postmark: { username: process.env.POSTMARK_HOOK_USER, password: process.env.POSTMARK_HOOK_PASS }, sendgrid: { verificationKey: process.env.SENDGRID_WEBHOOK_KEY }, // the public key SendGrid shows mailgun: { signingKey: process.env.MAILGUN_WEBHOOK_KEY }, ses: { topicArns: ['arn:aws:sns:eu-west-1:123456789012:email-events'] }, }, }),

Configure only the providers you use. An unknown provider gets 404, and a provider that isn't configured, or a request that fails verification, gets 401. Each provider event is stored once, however often the provider retries it. Hard bounces and complaints add the address to the suppression list; soft bounces and deferrals never do. A delivered event moves the email to delivered, but never over a bounce or complaint.

Opens and clicks reported by the provider are ignored by default, because the plugin's own pixel and redirector already count them. Set recordEngagement: true to store them as events too.

IP enrichment (optional)

Off by default: without this option the plugin makes no third-party calls. When you switch it on, the IP address of each open and click is looked up for its network details (ASN, organisation and the proxy, VPN, datacentre and mobile flags), which also sharpen the human/machine classification.

EmailTrackingPlugin.init({ // ... ipEnrichment: { provider: 'ipinfo', token: process.env.IPINFO_TOKEN }, // or { provider: 'ip-api', key: process.env.IPAPI_KEY }, or { provider: 'custom', lookup: async ip => ({ ... }) } }),
  • Only the IP address (and your API token, if the provider needs one) is sent, after the event is stored, so a lookup never holds up an email, a pixel or a redirect.
  • Private and reserved addresses are skipped, results are cached for 24 hours, and a per-minute budget is kept.
  • ip-api.com without a key uses its free endpoint, which is plain HTTP and for non-commercial use only under ip-api's terms; the plugin warns about this at boot.

Order activity and the evidence report

The order timeline is also available over HTTP, with a licence or during the evaluation, for roles with ReadOrder and ReadCustomer on the order's channel:

GET /email-track/orders/:orderId/activity?filter=opens&take=100 GET /email-track/orders/:orderId/activity.csv GET /email-track/orders/:orderId/activity.json // ?full=1 needs ExportEmailEvidence POST /email-track/orders/:orderId/evidence-link // a five-minute signed link to the PDF

The Order activity and delivery evidence report PDF lists the order, its customer and payment state, the email summary and the full timeline, with a note on how to read IP locations and machine-likely opens. It prints a SHA-256 of the timeline, so the document can be matched to a later JSON export. Private order notes are left out unless you ask for them.

Exports and the PDF are sent with Cache-Control: private, no-store, so a CDN never keeps them.

Suppression list

The plugin maintains an email_suppression table: recipients who should never be sent to. It is filled automatically by hard bounces and complaints from the bounce webhook and the provider webhooks, and you can add entries manually.

The suppression list is free and enforced at send for every email, whether it goes through TrackingEmailSender (the EmailPlugin) or EmailTrackingService: when a send is attempted for a suppressed recipient, the row is written to email_log with status='suppressed', and no SMTP call is made. A password reset is still sent, so a suppressed customer can always get back into their account.

The suppression endpoints are admin endpoints: call them with an admin session (cookie or Authorization: Bearer token). Listing needs ReadCustomer; adding and lifting need UpdateCustomer.

Adding entries manually

curl -X POST https://shop.example.com/email-track/suppression \ -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \ -d '{"recipient":"angry@example.com","reason":"manual","note":"Asked to be removed via support"}'

Lifting a suppression

curl -X DELETE -H "Authorization: Bearer $ADMIN_TOKEN" https://shop.example.com/email-track/suppression/angry@example.com

Listing the table

curl -H "Authorization: Bearer $ADMIN_TOKEN" "https://shop.example.com/email-track/suppression?take=200"

Bounce webhook

If your own postmaster integration or DSN parser reports bounces, POST them to /email-track/bounce, signed with your bounceWebhookSecret:

BODY='{"messageId":"<abc@mail.example.com>","status":"bounced","bounceType":"hard","reason":"550 5.1.1 The email account does not exist"}' SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$HULO_BOUNCE_WEBHOOK_SECRET" | cut -d' ' -f2) curl -X POST https://shop.example.com/email-track/bounce \ -H "Content-Type: application/json" -H "X-Signature: $SIG" -d "$BODY"

status is bounced or complained. A bounce must carry "bounceType":"hard" or "bounceType":"soft"; anything else is refused with 400. A soft bounce is recorded but never suppresses. The matching email_log row is updated and, for hard bounces and complaints, the recipient joins the suppression list, recipient by recipient.

The signature is the hex HMAC-SHA256 of the exact request body (a sha256= prefix is accepted too). The secret is bounceWebhookSecret, or a signingSecret you configured; with neither, the endpoint answers 503. On a private network only, allowUnauthenticatedBounceWebhook: true accepts unsigned requests.

Per-template analytics

With a licence or during the evaluation. For an aggregated view of how each email type performs, hit:

GET /email-track/log/stats/by-template?fromDays=30

Returns:

{ "days": 30, "types": [ { "type": "order-confirmation", "sent": 1247, "opened": 540, "clicked": 87, "bounced": 14, "failed": 12, "suppressed": 3, "openRate": 0.433, "clickRate": 0.070, "ctor": 0.161 // click-to-open }, ... ] }

CSV export

With a licence or during the evaluation, the list endpoint has a CSV mirror. Same filters, same shape:

GET /email-track/log/export.csv?status=sent&from=2026-05-01

Up to 50 000 rows per call. Cells that a spreadsheet would run as a formula are quoted.

Free and licensed

Every new installation has every feature on for its first 14 days, with no card and no licence key. After that the plugin keeps running in its free tier for as long as you like; a licence keeps the licensed features on. If a licence lapses, the licensed features stop and nothing is deleted: settings and data are kept, and a key switches them back on.

Free tier

  • A log of every e-mail with its SMTP reply and retries
  • Open and click recording; bots and Apple Mail Privacy Protection are kept out of the counts
  • The suppression list, enforced at send for every e-mail (password resets are still sent), with an admin page
  • Hard bounces and complaints from the bounce webhook (a hard or soft bounceType is required) and from verified provider webhooks
  • Each order's e-mails on its order page, and an Emails tab on every customer
  • Tracking on/off switches and trusted proxies
  • Privacy export and erase by address
  • The dashboard widget, with failed or bounced e-mails

Licensed (and the first 14 days)

  • Open and click rates per e-mail template
  • CSV export of the e-mail log
  • The order activity timeline and the PDF evidence report
  • Delivery, deferral, unsubscribe and engagement events from your e-mail provider
  • The weekly report and set-up checklist

Buy a monthly, annual (two months free) or lifetime licence from the plugin page, or click Subscribe (or Buy lifetime) on the licence banner of the plugin's admin page: checkout opens in a new tab and the key installs itself within a minute, renewals included. Already have a key? Paste it into the same banner (Activate), no redeploy, or set HULO_LICENCE_KEY_EMAIL_TRACKING; the environment key wins when both are present.

HTTP endpoints

MethodPathDescription
GET/email-track/open/:token.gifPublic pixel: records a signed open, then serves a 1×1 GIF
GET/email-track/click/:token?u=<url>&s=<sig>Public click redirector: checks the signed destination, records the click, then 302s
POST/email-track/webhook/:providerProvider delivery events (postmark, sendgrid, mailgun, ses), verified by the provider's signature
POST/email-track/bounceBounce / complaint webhook, signed with X-Signature
GET/email-track/orders/:orderId/activityAdmin: the order's activity timeline (licensed)
GET/email-track/orders/:orderId/activity.csvAdmin: redacted CSV of the timeline (licensed)
GET/email-track/orders/:orderId/activity.jsonAdmin: redacted JSON; ?full=1 needs ExportEmailEvidence (licensed)
POST/email-track/orders/:orderId/evidence-linkAdmin: a five-minute signed link to the PDF evidence report (licensed)
GET/email-track/orders/:orderId/evidence.pdfThe PDF evidence report, through its signed link
GET/email-track/logAdmin: paginated log with filters
GET/email-track/log/summaryAdmin: status totals
GET/email-track/log/:idAdmin: full detail, incl. opens and clicks
GET/email-track/log/stats/by-templateAdmin: per-template aggregates (licensed)
GET/email-track/log/export.csvAdmin: CSV export (licensed)
GET/email-track/suppressionAdmin: list suppressions
POST/email-track/suppressionAdmin: add a suppression
DELETE/email-track/suppression/:recipientAdmin: lift a suppression

Troubleshooting

Opens look like they come from Google or Microsoft

Many email clients fetch images through a proxy (Gmail's image proxy, Apple Mail Privacy Protection) and security gateways click links to scan them (Microsoft Safe Links, Proofpoint). Those events are stored and classified machine_likely with the reason, so you can tell them apart from real customers.

Clicks answer 400 "Invalid redirect target"

The redirector only follows its own signed links. A link copied from an email sent before a signing secret existed only redirects to your own hosts; add other domains to clickRedirectAllowedDomains to keep those working.

A provider webhook answers 401

The provider isn't configured in providerWebhooks, or its signature doesn't verify: check the credentials or key, and that nothing in front of Vendure (a proxy or WAF) rewrites the request body.

The suppression list isn't catching recent bounces

Make sure your provider webhook or bounce webhook reaches the server, and that the bounce carries the messageId your SMTP transport returned at send time; the plugin stores it as smtpMessageId on the email's row.