AboutSupportDeveloper GuideVersion 19.2.12

Hierarchy

Properties

Properties

onClick?: CustomData

onClick object that is user defined.

If provided, notification-action event will be raised when clicking on the fragment.

Example:

{
"type": "actionableText",
"dataKey": "titlexyz",
"tooltipKey": "some_key",
"onClick": { // contents are user-defined
"task": "schedule-reminder",
"eventId": 142341,
"intervalMs": 5000
}
}

import { addEventListener, clear } from 'openfin-notifications';

addEventListener('notification-action', (event: NotificationActionEvent<MyAction>)) => {
if (event.result.task === 'schedule-reminder') {
scheduleReminder(event.result.eventId, Date.now() + event.result.intervalMs);
}
clear(event.notification.id);
});
tooltipKey?: string

Tooltip key of the template fragment.

The string tooltip associated with this fragment will be looked up in templateData map with this key.

Example:

const myTemplate = {
body: {
compositions: [{
minTemplateAPIVersion: '1',
layout: {
type: "actionableText",
dataKey: 'message',
tooltipKey: 'tooltipxyz',
},
}],
},
}

const notificationOption: TemplateCustom = {
//...
templateOptions: myTemplate,
templateData: {
message: 'view stock tracker',
tooltipxyz: 'My Custom Tooltip',
}
};