Skip to main content

Tracking

NotificationHub records engagement per notification. Two ways to read it are exposed through client.notifications().

Delivery receipts

A NotificationReceipt carries the engagement fields for a single notification/channel pair:

FieldDescription
notificationIdThe notification this receipt belongs to.
tenantIdThe owning project.
channelWhich channel this receipt is for.
currentStatusCurrent delivery status.
firstOpenedAt / lastOpenedAtOpen timestamps, if tracked.
openCountNumber of recorded opens.
clickCount / lastClickedAtClick tracking, if applicable.
createdAt / updatedAtRecord lifecycle timestamps.
var receipt = client.notifications().get(notificationId);
System.out.println(receipt.openCount());

var allReceipts = client.notifications().getReceipts(notificationId);

Open tracking pixel

trackOpen(notificationId) fetches the raw tracking pixel bytes for a notification directly — this call is not HMAC-signed, since it's designed to be hit from an email client rendering an <img> tag rather than from your backend.

byte[] pixel = client.notifications().trackOpen(notificationId);

In practice, an email template's content typically embeds the pixel URL directly ({baseUrl}/track/open/{notificationId}) as an <img src="...">, so the recipient's mail client triggers the tracking hit — your application code usually doesn't need to call trackOpen itself unless you're building a custom tracking surface.