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:
| Field | Description |
|---|---|
notificationId | The notification this receipt belongs to. |
tenantId | The owning project. |
channel | Which channel this receipt is for. |
currentStatus | Current delivery status. |
firstOpenedAt / lastOpenedAt | Open timestamps, if tracked. |
openCount | Number of recorded opens. |
clickCount / lastClickedAt | Click tracking, if applicable. |
createdAt / updatedAt | Record lifecycle timestamps. |
- Java
- Node.js
var receipt = client.notifications().get(notificationId);
System.out.println(receipt.openCount());
var allReceipts = client.notifications().getReceipts(notificationId);
const receipt = await client.notifications().get(notificationId);
console.log(receipt.openCount);
const allReceipts = await 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.
- Java
- Node.js
byte[] pixel = client.notifications().trackOpen(notificationId);
const pixel: ArrayBuffer = await 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.